From eb92cef0b2aa89a77c5e7dd6c4cf41975a04ca86 Mon Sep 17 00:00:00 2001 From: binaryify Date: Mon, 29 Apr 2024 17:37:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20song/url=20=E5=8F=82=E6=95=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.MD | 3 +++ module/comment_album.js | 4 ++-- module/song_url.js | 16 ++++++---------- package.json | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 2fe3c1d..4eda6c5 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,7 @@ # 更新日志 +### 4.17.0 | 2024.04.29 +# song/url 参数问题修复 + ### 4.17.0 | 2024.04.29 - ua 更新 - cookie 处理优化 diff --git a/module/comment_album.js b/module/comment_album.js index 162fd3d..49962da 100644 --- a/module/comment_album.js +++ b/module/comment_album.js @@ -1,7 +1,7 @@ // 专辑评论 module.exports = (query, request) => { - query.cookie.os = 'pc' + // query.cookie.os = 'pc' // query.cookie.appver = '2.9.7' const data = { rid: query.id, @@ -11,7 +11,7 @@ module.exports = (query, request) => { } return request( 'POST', - `https://music.163.com/weapi/v1/resource/comments/R_AL_3_${query.id}`, + `https://music.163.com/api/v1/resource/comments/R_AL_3_${query.id}`, data, { crypto: 'weapi', diff --git a/module/song_url.js b/module/song_url.js index 5d9dbe8..ad427f3 100644 --- a/module/song_url.js +++ b/module/song_url.js @@ -1,26 +1,22 @@ // 歌曲链接 module.exports = async (query, request) => { + query.cookie.os = 'pc' const ids = String(query.id).split(',') const data = { - trialMode: 2, - immerseType: 'ste', - ids: '["1328146041"]', - os: 'iOS', - level: 'exhigh', - deviceId: 'a8c8c4d613b999dc5d13277b43c7e925', - encodeType: 'aac', - extPlay: 0, + ids: JSON.stringify(ids), + br: parseInt(query.br || 999000), } const res = await request( 'POST', - `https://music.163.com/api/song/enhance/player/url/v1`, + `https://interface3.music.163.com/eapi/song/enhance/player/url`, data, { - crypto: 'weapi', + crypto: 'eapi', cookie: query.cookie, ua: query.ua || '', proxy: query.proxy, realIP: query.realIP, + url: '/api/song/enhance/player/url', }, ) // 根据id排序 diff --git a/package.json b/package.json index 729508a..2cd6fc6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "4.17.0", + "version": "4.17.1", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js",