redo cookie modification with cookie parser

This commit is contained in:
Nzix
2018-10-05 15:57:50 +08:00
parent 2bcccd46df
commit 71d832384c
11 changed files with 22 additions and 19 deletions
+15
View File
@@ -0,0 +1,15 @@
// 歌曲链接
const crypto = require('crypto')
module.exports = (query, request) => {
if(!('MUSIC_U' in query.cookie)) query.cookie._ntes_nuid = crypto.randomBytes(16).toString("hex")
const data = {
ids: '[' + parseInt(query.id) + ']',
br: parseInt(query.br || 999000)
}
return request(
'POST', `http://music.163.com/weapi/song/enhance/player/url`, data,
{crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}
)
}