From 4afb471d331d693ca25d1a8b9bb912d187880f25 Mon Sep 17 00:00:00 2001 From: huggy <6511667+makeding@users.noreply.github.com> Date: Thu, 10 Sep 2020 23:54:22 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=BA=86=E4=B8=8B=20UA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/request.js | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/util/request.js b/util/request.js index b0d3b473c3f..251253d93b5 100644 --- a/util/request.js +++ b/util/request.js @@ -8,19 +8,25 @@ const zlib = require('zlib') const chooseUserAgent = ua => { const userAgentList = [ - 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1', - 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1', - 'Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Mobile Safari/537.36', - 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Mobile Safari/537.36', - 'Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Mobile Safari/537.36', - 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/603.2.4 (KHTML, like Gecko) Mobile/14F89;GameHelper', - 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) AppleWebKit/602.1.38 (KHTML, like Gecko) Version/10.0 Mobile/14A300 Safari/602.1', - 'Mozilla/5.0 (iPad; CPU OS 10_0 like Mac OS X) AppleWebKit/602.1.38 (KHTML, like Gecko) Version/10.0 Mobile/14A300 Safari/602.1', - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:46.0) Gecko/20100101 Firefox/46.0', - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36', - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4', - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:46.0) Gecko/20100101 Firefox/46.0', - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36', + // iOS 13.5.1 14.0 beta with safari + 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1', + 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.', + // iOS with qq micromsg + 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML like Gecko) Mobile/14A456 QQ/6.5.7.408 V1_IPH_SQ_6.5.7_1_APP_A Pixel/750 Core/UIWebView NetType/4G Mem/103', + 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.15(0x17000f27) NetType/WIFI Language/zh', + // Android -> Huawei Xiaomi + 'Mozilla/5.0 (Linux; Android 9; PCT-AL10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.64 HuaweiBrowser/10.0.3.311 Mobile Safari/537.36', + 'Mozilla/5.0 (Linux; U; Android 9; zh-cn; Redmi Note 8 Build/PKQ1.190616.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.5.22', + // Android with qq micromsg + 'Mozilla/5.0 (Linux; Android 10; YAL-AL00 Build/HUAWEIYAL-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.62 XWEB/2581 MMWEBSDK/200801 Mobile Safari/537.36 MMWEBID/3027 MicroMessenger/7.0.18.1740(0x27001235) Process/toolsmp WeChat/arm64 NetType/WIFI Language/zh_CN ABI/arm64', + 'Mozilla/5.0 (Linux; U; Android 8.1.0; zh-cn; BKK-AL10 Build/HONORBKK-AL10) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/10.6 Mobile Safari/537.36', + // macOS 10.15.6 Firefox / Chrome / Safari + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0', + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.30 Safari/537.36', + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15', + // Windows 10 Firefox / Chrome / Edge + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0', + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.30 Safari/537.36', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/13.10586' ] let index = 0 @@ -52,7 +58,7 @@ const createRequest = (method, url, data, options) => { ) .join('; ') else if (options.cookie) headers['Cookie'] = options.cookie - + if (!headers['Cookie']) { headers['Cookie'] = options.token || '' } @@ -68,7 +74,7 @@ const createRequest = (method, url, data, options) => { params: data }) headers['User-Agent'] = - 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36' + 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36' url = 'https://music.163.com/api/linux/forward' } else if (options.crypto === 'eapi') { const cookie = options.cookie || {}; @@ -134,10 +140,10 @@ const createRequest = (method, url, data, options) => { zlib.unzip(body, function (err, buffer) { const _buffer = err ? body : buffer try { - try{ + try { answer.body = JSON.parse(encrypt.decrypt(_buffer).toString()) answer.status = answer.body.code || res.statusCode - } catch(e){ + } catch (e) { answer.body = JSON.parse(_buffer.toString()) answer.status = res.statusCode } @@ -156,7 +162,7 @@ const createRequest = (method, url, data, options) => { answer.body = JSON.parse(body) answer.status = answer.body.code || res.statusCode - if(answer.body.code === 502){ + if (answer.body.code === 502) { answer.status = 200 } } From 9ee30f363a4d6645aa0e7ac7612ca666b644590e Mon Sep 17 00:00:00 2001 From: huggy <6511667+makeding@users.noreply.github.com> Date: Fri, 11 Sep 2020 00:17:05 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=8B=20UA?= =?UTF-8?q?=20=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91=20.gitignore=20?= =?UTF-8?q?=E5=BC=84=E5=BE=97=E5=A5=BD=E7=9C=8B=E4=BA=86=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 +--- util/request.js | 70 +++++++++++++++++++++++++++---------------------- 2 files changed, 40 insertions(+), 35 deletions(-) diff --git a/.gitignore b/.gitignore index 4a4d9a93dec..f284b532d73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,5 @@ .DS_Store node_modules *.log - -.idea/ - - +.idea .vscode \ No newline at end of file diff --git a/util/request.js b/util/request.js index 251253d93b5..fc4df40972d 100644 --- a/util/request.js +++ b/util/request.js @@ -6,38 +6,46 @@ const zlib = require('zlib') // request.debug = true // 开启可看到更详细信息 -const chooseUserAgent = ua => { - const userAgentList = [ - // iOS 13.5.1 14.0 beta with safari - 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1', - 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.', - // iOS with qq micromsg - 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML like Gecko) Mobile/14A456 QQ/6.5.7.408 V1_IPH_SQ_6.5.7_1_APP_A Pixel/750 Core/UIWebView NetType/4G Mem/103', - 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.15(0x17000f27) NetType/WIFI Language/zh', - // Android -> Huawei Xiaomi - 'Mozilla/5.0 (Linux; Android 9; PCT-AL10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.64 HuaweiBrowser/10.0.3.311 Mobile Safari/537.36', - 'Mozilla/5.0 (Linux; U; Android 9; zh-cn; Redmi Note 8 Build/PKQ1.190616.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.5.22', - // Android with qq micromsg - 'Mozilla/5.0 (Linux; Android 10; YAL-AL00 Build/HUAWEIYAL-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.62 XWEB/2581 MMWEBSDK/200801 Mobile Safari/537.36 MMWEBID/3027 MicroMessenger/7.0.18.1740(0x27001235) Process/toolsmp WeChat/arm64 NetType/WIFI Language/zh_CN ABI/arm64', - 'Mozilla/5.0 (Linux; U; Android 8.1.0; zh-cn; BKK-AL10 Build/HONORBKK-AL10) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/10.6 Mobile Safari/537.36', - // macOS 10.15.6 Firefox / Chrome / Safari - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0', - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.30 Safari/537.36', - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15', - // Windows 10 Firefox / Chrome / Edge - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0', - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.30 Safari/537.36', - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/13.10586' - ] - let index = 0 - if (typeof ua == 'undefined') - index = Math.floor(Math.random() * userAgentList.length) - else if (ua === 'mobile') index = Math.floor(Math.random() * 7) - else if (ua === 'pc') index = Math.floor(Math.random() * 5) + 8 - else return ua - return userAgentList[index] +function chooseUserAgent(ua = false) { + // UA 列表要经常更新啊 + const userAgentList = { + mobile: [ + // iOS 13.5.1 14.0 beta with safari + 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1', + 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.', + // iOS with qq micromsg + 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML like Gecko) Mobile/14A456 QQ/6.5.7.408 V1_IPH_SQ_6.5.7_1_APP_A Pixel/750 Core/UIWebView NetType/4G Mem/103', + 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.15(0x17000f27) NetType/WIFI Language/zh', + // Android -> Huawei Xiaomi + 'Mozilla/5.0 (Linux; Android 9; PCT-AL10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.64 HuaweiBrowser/10.0.3.311 Mobile Safari/537.36', + 'Mozilla/5.0 (Linux; U; Android 9; zh-cn; Redmi Note 8 Build/PKQ1.190616.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.5.22', + // Android + qq micromsg + 'Mozilla/5.0 (Linux; Android 10; YAL-AL00 Build/HUAWEIYAL-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.62 XWEB/2581 MMWEBSDK/200801 Mobile Safari/537.36 MMWEBID/3027 MicroMessenger/7.0.18.1740(0x27001235) Process/toolsmp WeChat/arm64 NetType/WIFI Language/zh_CN ABI/arm64', + 'Mozilla/5.0 (Linux; U; Android 8.1.0; zh-cn; BKK-AL10 Build/HONORBKK-AL10) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/10.6 Mobile Safari/537.36', + ], + pc: [ + // macOS 10.15.6 Firefox / Chrome / Safari + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0', + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.30 Safari/537.36', + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15', + // Windows 10 Firefox / Chrome / Edge + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0', + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.30 Safari/537.36', + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/13.10586' + // Linux 就算了 + ] + } + let realUserAgentList = [] + if (!ua) + realUserAgentList = (userAgentList.mobile).concat(userAgentList.pc) // concat 把两个 array 合并 + else if (ua == 'mobile') + realUserAgentList = userAgentList.mobile + else if (ua == 'pc') + realUserAgentList = userAgentList.pc + else + return ua // 最后返回自定义的 ua + return realUserAgentList[Math.floor(Math.random() * realUserAgentList.length)] } - const createRequest = (method, url, data, options) => { return new Promise((resolve, reject) => { let headers = { 'User-Agent': chooseUserAgent(options.ua) } From c05c83db14cf9d7f6daf5137c30addec93886641 Mon Sep 17 00:00:00 2001 From: huggy <6511667+makeding@users.noreply.github.com> Date: Fri, 11 Sep 2020 00:32:21 +0800 Subject: [PATCH 3/6] =?UTF-8?q?readme=20=E4=BF=AE=E6=94=B9=E6=88=90=20http?= =?UTF-8?q?s=20=E5=85=8B=E9=9A=86=EF=BC=88=E4=B8=8D=E7=94=A8=E7=99=BB?= =?UTF-8?q?=E5=BD=95=20=E4=BF=AE=E6=94=B9=20/public=20=E5=87=A0=E4=B8=AA?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=BD=91=E9=A1=B5=20=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E4=BA=86=20http://localhost:port/=20public=20=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E7=BD=91=E9=A1=B5=20lang=20=E9=83=BD?= =?UTF-8?q?=E6=94=B9=E6=88=90=20zh=20=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.MD | 2 +- public/avatar_update.html | 154 +++++++++++++-------------- public/index.html | 30 ++++-- public/playlist_cover_update.html | 166 +++++++++++++++--------------- public/test.html | 119 ++++++++++----------- 5 files changed, 243 insertions(+), 228 deletions(-) diff --git a/README.MD b/README.MD index 957fc00ccd6..95b5731d687 100644 --- a/README.MD +++ b/README.MD @@ -192,7 +192,7 @@ ## 安装 ```shell -$ git clone git@github.com:Binaryify/NeteaseCloudMusicApi.git +$ git clone https://github.com/Binaryify/NeteaseCloudMusicApi.git $ npm install ``` diff --git a/public/avatar_update.html b/public/avatar_update.html index cc3caa299f8..45c2b8284c8 100644 --- a/public/avatar_update.html +++ b/public/avatar_update.html @@ -1,80 +1,82 @@ - - - - - 更新头像 - - - - - - - - + } + }) + } + + + + \ No newline at end of file diff --git a/public/index.html b/public/index.html index 42c1788bfc0..c3bbc3b9111 100644 --- a/public/index.html +++ b/public/index.html @@ -1,11 +1,13 @@ - + + 网易云音乐 API +

网易云音乐 API

当你看到这个页面时,这个服务已经成功跑起来了~ @@ -17,32 +19,40 @@

例子:

  • 3. 电台节目
  • + \ No newline at end of file diff --git a/public/playlist_cover_update.html b/public/playlist_cover_update.html index dde976bba1f..e6b1bd7b2e2 100644 --- a/public/playlist_cover_update.html +++ b/public/playlist_cover_update.html @@ -1,86 +1,88 @@ - - - - - 歌单封面上传 - - - - - - - - - + } + }) + } + + + + \ No newline at end of file diff --git a/public/test.html b/public/test.html index 804bd929f15..d0e87681a18 100644 --- a/public/test.html +++ b/public/test.html @@ -1,62 +1,63 @@ - - - - - - test - + - -

    请在控制台看结果

    - - - - - + +

    请在控制台看结果

    + + + + + + \ No newline at end of file From e933997d26f6ba26612026c75627f586cc34ddde Mon Sep 17 00:00:00 2001 From: huggy <6511667+makeding@users.noreply.github.com> Date: Fri, 11 Sep 2020 10:24:52 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=8F=88=E4=BC=98=E5=8C=96=E4=BA=86?= =?UTF-8?q?=E4=B8=8B=20UA=20=E9=80=BB=E8=BE=91=20=E7=8E=B0=E5=9C=A8?= =?UTF-8?q?=E4=B8=A4=E8=A1=8C=E5=B0=B1=20ok=20=E4=BA=86=20https://github.c?= =?UTF-8?q?om/Binaryify/NeteaseCloudMusicApi/pull/922?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/request.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/util/request.js b/util/request.js index fc4df40972d..ccb4d87440b 100644 --- a/util/request.js +++ b/util/request.js @@ -35,16 +35,8 @@ function chooseUserAgent(ua = false) { // Linux 就算了 ] } - let realUserAgentList = [] - if (!ua) - realUserAgentList = (userAgentList.mobile).concat(userAgentList.pc) // concat 把两个 array 合并 - else if (ua == 'mobile') - realUserAgentList = userAgentList.mobile - else if (ua == 'pc') - realUserAgentList = userAgentList.pc - else - return ua // 最后返回自定义的 ua - return realUserAgentList[Math.floor(Math.random() * realUserAgentList.length)] + let realUserAgentList = userAgentList[ua] || (userAgentList.mobile).concat(userAgentList.pc) + return (['mobile', 'pc', false].indexOf(ua) > -1) ? realUserAgentList[Math.floor(Math.random() * realUserAgentList.length)] : ua } const createRequest = (method, url, data, options) => { return new Promise((resolve, reject) => { From 1e4a90f19aa6a92f2bd3f44130c69edfd88f7417 Mon Sep 17 00:00:00 2001 From: huggy <6511667+makeding@users.noreply.github.com> Date: Fri, 11 Sep 2020 10:50:16 +0800 Subject: [PATCH 5/6] =?UTF-8?q?chooseUserAgent=20function=20->=20const=20?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E5=87=BD=E6=95=B0=E9=87=8D=E6=9E=84=E4=BA=86?= =?UTF-8?q?=20=E7=9B=B4=E6=8E=A5=E7=94=A8=20function=20=E4=BA=86=20?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=B3=A8=E6=84=8F=E5=88=B0=E5=85=B6=E5=AE=83?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E6=98=AF=E5=8F=98=E9=87=8F=E5=BD=A2=E5=BC=8F?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/request.js b/util/request.js index ccb4d87440b..f68537d11c2 100644 --- a/util/request.js +++ b/util/request.js @@ -6,7 +6,7 @@ const zlib = require('zlib') // request.debug = true // 开启可看到更详细信息 -function chooseUserAgent(ua = false) { +const chooseUserAgent = (ua = false) => { // UA 列表要经常更新啊 const userAgentList = { mobile: [ From 44e0ac418248fce6610b847cb64a9ef9948cf5d7 Mon Sep 17 00:00:00 2001 From: huggy <6511667+makeding@users.noreply.github.com> Date: Fri, 11 Sep 2020 17:03:04 +0800 Subject: [PATCH 6/6] =?UTF-8?q?Linux=20=E7=9A=84=20UA=20=E6=94=B9=E5=9B=9E?= =?UTF-8?q?=E5=8E=9F=E6=9D=A5=E7=9A=84=E7=89=88=E6=9C=AC=20=E5=9C=A8=20Dee?= =?UTF-8?q?pin=20=E4=B8=8B=E6=B5=8B=E8=AF=95=201.2.0(0408)=20UA=20?= =?UTF-8?q?=E6=98=AF=20Chrome=2060=20=EF=BC=8C=E5=B9=B6=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E8=B7=9F=E7=9D=80=E7=B3=BB=E7=BB=9F=E7=89=88=E6=9C=AC=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/request.js b/util/request.js index f68537d11c2..fcf75bec0db 100644 --- a/util/request.js +++ b/util/request.js @@ -74,7 +74,7 @@ const createRequest = (method, url, data, options) => { params: data }) headers['User-Agent'] = - 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36' + 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36' url = 'https://music.163.com/api/linux/forward' } else if (options.crypto === 'eapi') { const cookie = options.cookie || {};