From 2a80b9a52037c8653291322cdae8e18bb629493a Mon Sep 17 00:00:00 2001 From: Listen 1 Date: Wed, 30 May 2018 19:59:45 +0800 Subject: [PATCH] change qq music provider API --- README.md | 5 ++++- js/provider/qq.js | 21 +++++++++++++-------- listen1.html | 2 +- manifest.json | 2 +- manifest_firefox.json | 2 +- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2dd9461..6a1f8c9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Listen 1 (Chrome Extension) V1.6.0 +Listen 1 (Chrome Extension) V1.6.1 ========== (最后更新于2018年04月23日) @@ -45,6 +45,9 @@ Firefox打包安装 更新日志 ------- +`2018-05-30` +* 修复QQ音乐无法播放的问题(感谢@noschoollee 提供修复方案) + `2018-04-23` * 修复虾米音乐无法播放的问题 diff --git a/js/provider/qq.js b/js/provider/qq.js index 6261481..99ba814 100644 --- a/js/provider/qq.js +++ b/js/provider/qq.js @@ -237,10 +237,13 @@ var qq = (function() { } var qq_bootstrap_track = function(sound, track, success, failure, hm, se) { - var target_url ='http://base.music.qq.com/fcgi-bin/fcg_musicexpress.fcg?' + - 'json=3&guid=780782017&g_tk=938407465&loginUin=0&hostUin=0&' + - 'format=jsonp&inCharset=GB2312&outCharset=GB2312¬ice=0&' + - 'platform=yqq&jsonpCallback=jsonCallback&needNewCode=0'; + var target_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¬ice=0&platform=yqq&needNewCode=0' + + '&cid=205361747&callback=MusicJsonCallback004680169373158849' + + '&uin=1297716249&songmid='+ track.id.slice('qqtrack_'.length) + + '&filename=C400'+ track.id.slice('qqtrack_'.length) + '.m4a&guid=7332953645'; hm({ url:target_url, @@ -249,11 +252,13 @@ var qq = (function() { }) .then(function(response) { var data = response.data; - data = data.slice('jsonCallback('.length, -');'.length); + data = data.slice(data.indexOf('(')+1,data.length-1); data = JSON.parse(data); - var token = data.key; - var url = 'http://dl.stream.qqmusic.qq.com/C200' + track.id.slice('qqtrack_'.length) + '.m4a?vkey=' + - token + '&fromtag=0&guid=780782017'; + var token = data.data.items[0].vkey; + var url = 'http://dl.stream.qqmusic.qq.com/C400' + + track.id.slice('qqtrack_'.length) + + '.m4a?vkey=' + token + + '&uin=1297716249&fromtag=0&guid=7332953645'; sound.url = url; success(); }); diff --git a/listen1.html b/listen1.html index a0d2548..a9de37b 100644 --- a/listen1.html +++ b/listen1.html @@ -351,7 +351,7 @@

Listen 1 主页: http://listen1.github.io/listen1/

Listen 1 邮箱: githublisten1@gmail.com

-

当前版本 1.6.0 (本软件基于MIT协议开源免费)

+

当前版本 1.6.1 (本软件基于MIT协议开源免费)

diff --git a/manifest.json b/manifest.json index a9dcfc4..674b143 100644 --- a/manifest.json +++ b/manifest.json @@ -15,7 +15,7 @@ "manifest_version": 2, "name": "Listen 1", "permissions": [ "notifications", "unlimitedStorage", "downloads", "storage", "contextMenus", "tabs", "*://music.163.com/*", "*://*.xiami.com/*", "*://*.qq.com/*", "*://api.github.com/*", "*://github.com/*", "webRequest", "webRequestBlocking"], - "version": "1.6.0", + "version": "1.6.1", "web_accessible_resources": [ "images/*" ], "content_scripts": [{ "matches": ["https://listen1.github.io/listen1/*"], diff --git a/manifest_firefox.json b/manifest_firefox.json index e8195b2..0264ea6 100644 --- a/manifest_firefox.json +++ b/manifest_firefox.json @@ -21,7 +21,7 @@ "manifest_version": 2, "name": "Listen 1", "permissions": [ "notifications", "unlimitedStorage", "downloads", "storage", "contextMenus", "tabs", "*://music.163.com/*", "*://*.xiami.com/*", "*://*.qq.com/*", "*://api.github.com/*", "*://github.com/*", "webRequest", "webRequestBlocking"], - "version": "1.6.0", + "version": "1.6.1", "web_accessible_resources": [ "images/*" ], "content_scripts": [{ "matches": ["https://listen1.github.io/listen1/*"],