Skip to content

Commit

Permalink
have to downgrade to 128k mp3 for qq #30
Browse files Browse the repository at this point in the history
  • Loading branch information
nondanee committed Mar 20, 2019
1 parent f6d3804 commit 946ff41
Showing 1 changed file with 50 additions and 37 deletions.
87 changes: 50 additions & 37 deletions provider/qq.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,57 +40,70 @@ const ticket = () => {
const exclusive = ['003OUlho2HcRHC', '0039MnYb0qxYhV', '003aAYrm3GE0Ac', '001J5QJL1pRQYB', '004Z8Ihr0JIu5s', '002MXZNu1GToOk', '002qU5aY3Qu24y', '001xd0HI0X9GNq', '001zMQr71F1Qo8', '0009BCJK1nRaad']
const id = exclusive[Math.floor(exclusive.length * Math.random())]

let url =
'https://c.y.qq.com/base/fcgi-bin/fcg_music_express_mobile3.fcg' +
'?g_tk=195219765&jsonpCallback=MusicJsonCallback004680169373158849' +
'&loginUin=1297716249&hostUin=0&format=json&inCharset=utf8' +
'&outCharset=utf-8&notice=0&platform=yqq&needNewCode=0' +
'&cid=205361747&callback=MusicJsonCallback004680169373158849' +
'&uin=1297716249&songmid='+ id +
'&filename=C400'+ id + '.m4a&guid=7332953645'
// let url =
// 'https://c.y.qq.com/base/fcgi-bin/fcg_music_express_mobile3.fcg' +
// '?g_tk=195219765&jsonpCallback=MusicJsonCallback004680169373158849' +
// '&loginUin=1297716249&hostUin=0&format=json&inCharset=utf8' +
// '&outCharset=utf-8&notice=0&platform=yqq&needNewCode=0' +
// '&cid=205361747&callback=MusicJsonCallback004680169373158849' +
// '&uin=1297716249&songmid='+ id +
// '&filename=C400'+ id + '.m4a&guid=7332953645'

return request('GET', url, headers)
.then(response => response.jsonp())
// return request('GET', url, headers)
// .then(response => response.jsonp())
// .then(jsonBody => {
// let vkey = jsonBody.data.items[0].vkey
// if(vkey)
// return vkey
// else
// return Promise.reject()
// })
// .catch(() => insure().qq.ticket())

let url =
'https://u.y.qq.com/cgi-bin/musicu.fcg?data=' +
encodeURIComponent(JSON.stringify({
// req: {
// method: 'GetCdnDispatch',
// module: 'CDN.SrfCdnDispatchServer',
// param: {
// calltype: 0,
// guid: '7332953645',
// userip: ''
// }
// },
req_0: {
module: 'vkey.GetVkeyServer',
method: 'CgiGetVkey',
param: {
guid: '7332953645',
loginflag: 1,
songmid: [id],
songtype: [0],
uin: '0',
platform: '20'
}
}
}))

return request('GET', url)
.then(response => response.json())
.then(jsonBody => {
let vkey = jsonBody.data.items[0].vkey
let vkey = jsonBody.req_0.data.midurlinfo[0].vkey
if(vkey)
return vkey
else
return Promise.reject()
})
.catch(() => insure().qq.ticket())

// let url = 'https://u.y.qq.com/cgi-bin/musicu.fcg?data=' +
// encodeURIComponent(JSON.stringify({
// req_0: {
// module: 'vkey.GetVkeyServer',
// method: 'CgiGetVkey',
// param: {
// guid: '7332953645',
// songmid: [id],
// songtype: [0],
// uin: '',
// platform: '20'
// }
// }
// }))

// return request('GET', url).then(response => {
// let jsonBody = JSON.parse(response.body)
// return jsonBody.req_0.data.midurlinfo[0].vkey
// })
}

const track = id => {
return cache(ticket)
.then(vkey => {
let host = ['streamoc.music.tc.qq.com', 'isure.stream.qqmusic.qq.com', 'dl.stream.qqmusic.qq.com'][0]
// let songUrl =
// 'http://dl.stream.qqmusic.qq.com/C400' + id +
// '.m4a?vkey=' + vkey +
// '&uin=1297716249&fromtag=0&guid=7332953645'
let host = ['streamoc.music.tc.qq.com', 'isure.stream.qqmusic.qq.com', 'dl.stream.qqmusic.qq.com'][2]
let songUrl =
'http://' + host + '/M800' + id +
'http://' + host + '/M500' + id +
'.mp3?vkey=' + vkey +
'&uin=0&fromtag=8&guid=7332953645'
return songUrl
Expand Down

0 comments on commit 946ff41

Please sign in to comment.