更新酷狗歌曲信息接口
This commit is contained in:
1 parent
92655b6b7c
commit
a8e9c78aeb
1 file changed
+15
-1
+15
-1
@@ -7,6 +7,17 @@
|
||||
|
||||
const request = require('request');
|
||||
|
||||
function randomString(len) {
|
||||
len = len || 32;
|
||||
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
var maxPos = chars.length;
|
||||
var pwd = '';
|
||||
for (i = 0; i < len; i++) {
|
||||
pwd += chars.charAt(Math.floor(Math.random() * maxPos));
|
||||
}
|
||||
return pwd;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
getSearchSongList:function(param,req,callback){
|
||||
@@ -58,8 +69,11 @@ module.exports = {
|
||||
let proxy_url = 'http://www.kugou.com/yy/index.php?r=play/getdata&hash='+hash;
|
||||
|
||||
let options = {
|
||||
headers: {"Connection": "close"},
|
||||
url: proxy_url,
|
||||
headers: {
|
||||
"Connection": "close",
|
||||
"Cookie":"kg_mid="+randomString()
|
||||
},
|
||||
method: req.method.toUpperCase(),
|
||||
json: true,
|
||||
body: req.body
|
||||
|
||||
Reference in new issue
Block a user