提交 5b28a17c 编写于 作者: B binaryify 提交者: GitHub

Merge pull request #291 from nondanee/bandage

解决歌曲URL请求被判Cheating
function randomString(pattern, length){
return Array.apply(null, {length: length}).map(() => (pattern[Math.floor(Math.random() * pattern.length)])).join('');
}
const jsessionid = randomString('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKMNOPQRSTUVWXYZ\\/+',176) + ':' + (new Date).getTime();
const nuid = randomString('0123456789abcdefghijklmnopqrstuvwxyz',32);
module.exports = `JSESSIONID-WYYY=${jsessionid}; _iuqxldmzr_=32; _ntes_nnid=${nuid},${(new Date).getTime()}; _ntes_nuid=${nuid}`;
\ No newline at end of file
const Encrypt = require("./crypto.js");
const request = require("request");
const querystring = require("querystring");
const baseCookie = require("./init.js");
request.debug = true;
......@@ -56,7 +57,7 @@ function createWebAPIRequest(
"Content-Type": "application/x-www-form-urlencoded",
Referer: "http://music.163.com",
Host: "music.163.com",
Cookie: cookie,
Cookie: baseCookie + (cookie ? "; " : "") + cookie,
"User-Agent": randomUserAgent()
},
body: querystring.stringify({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册