From 679be3df69092b2bb6c1a3e751a0bf6d052d98cd Mon Sep 17 00:00:00 2001 From: binaryify Date: Sat, 1 May 2021 16:46:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5-=E5=8F=91=E7=8E=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=A2=9E=E5=8A=A0=20cursor=20=E5=8F=82=E6=95=B0,refre?= =?UTF-8?q?sh=E9=BB=98=E8=AE=A4=E8=AE=BE=E4=B8=BAfalse=20#1217?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.MD | 5 +++ docs/README.md | 14 ++++----- interface.d.ts | 5 ++- module/homepage_block_page.js | 2 +- module/song_detail.js | 2 +- package.json | 2 +- public/home.html | 58 +++++++++++++++++++++++++++++++++++ public/login.html | 47 ++++++++++++++++++++++++++++ 8 files changed, 123 insertions(+), 12 deletions(-) create mode 100644 public/home.html create mode 100644 public/login.html diff --git a/CHANGELOG.MD b/CHANGELOG.MD index f1f12a7..27fb1cf 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,9 @@ # 更新日志 +### 4.0.12 | 2021.5.1 +- 首页-发现接口增加 cursor 参数,refresh默认设为false [#1217](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1217) + +- 更新`song/detail` 接口 + ### 4.0.11 | 2021.4.26 - 新增云盘歌曲信息匹配纠正接口 [#1212](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1212) diff --git a/docs/README.md b/docs/README.md index 6773ab4..f941669 100644 --- a/docs/README.md +++ b/docs/README.md @@ -260,7 +260,7 @@ $ set HOST=127.0.0.1 && node app.js ``` ## Vercel 部署 -v4.0.8 加入了 Vercel 配置文件,可以直接在 Vercel 下部署了,不需要自己的服务器 +v4.0.8 加入了 Vercel 配置文件,可以直接在 Vercel 下部署了,不需要自己的服务器(访问Vercel部署的接口,需要额外加一个realIP参数,如 `/song/url?id=191254&realIP=116.25.146.177`) ### 操作方法 1. fork 此项目 2. 在 Vercel 官网点击 `New Project` @@ -1502,7 +1502,9 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具 **接口地址 :** `/homepage/block/page` -**可选参数 :** `refresh`: 是否刷新数据,默认为true +**可选参数 :** `refresh`: 是否刷新数据,默认为false + +`cursor`: 上一条数据返回的cursor ### 首页-发现-圆形图标入口列表 @@ -1934,7 +1936,7 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具 ### 获取歌曲详情 -说明 : 调用此接口 , 传入音乐 id(支持多个 id, 用 `,` 隔开), 可获得歌曲详情(注意:歌曲封面现在需要通过专辑内容接口获取) +说明 : 调用此接口 , 传入音乐 id(支持多个 id, 用 `,` 隔开), 可获得歌曲详情 **必选参数 :** `ids`: 音乐 id, 如 `ids=347230` @@ -1942,8 +1944,7 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具 **调用例子 :** `/song/detail?ids=347230`,`/song/detail?ids=347230,347231` -返回数据如下图 : -![获取歌曲详情](https://raw.githubusercontent.com/Binaryify/NeteaseCloudMusicApi/master/static/songDetail.png) + ### 获取专辑内容 @@ -1955,9 +1956,6 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具 **调用例子 :** `/album?id=32311` -返回数据如下图 : -![获取专辑内容](https://raw.githubusercontent.com/Binaryify/NeteaseCloudMusicApi/master/static/%E4%B8%93%E8%BE%91.png) - ### 专辑动态信息 说明 : 调用此接口 , 传入专辑 id, 可获得专辑动态信息,如是否收藏,收藏数,评论数,分享数 diff --git a/interface.d.ts b/interface.d.ts index e8cced2..9b134e2 100644 --- a/interface.d.ts +++ b/interface.d.ts @@ -643,7 +643,10 @@ export function history_recommend_songs_detail( ): Promise export function homepage_block_page( - params: { refresh?: 'true' | 'false' | boolean } & RequestBaseConfig, + params: { + refresh?: 'true' | 'false' | boolean + cursor?: string + } & RequestBaseConfig, ): Promise export function homepage_dragon_ball( diff --git a/module/homepage_block_page.js b/module/homepage_block_page.js index 618e534..af4b074 100644 --- a/module/homepage_block_page.js +++ b/module/homepage_block_page.js @@ -4,7 +4,7 @@ module.exports = (query, request) => { query.cookie.os = 'ios' query.cookie.appver = '8.1.20' - const data = { refresh: query.refresh || true } + const data = { refresh: query.refresh || false, cursor: query.cursor } return request( 'POST', `https://music.163.com/api/homepage/block/page`, diff --git a/module/song_detail.js b/module/song_detail.js index 172b34c..338fddc 100644 --- a/module/song_detail.js +++ b/module/song_detail.js @@ -5,7 +5,7 @@ module.exports = (query, request) => { const data = { c: '[' + query.ids.map((id) => '{"id":' + id + '}').join(',') + ']', } - return request('POST', `https://music.163.com/weapi/v3/song/detail`, data, { + return request('POST', `https://music.163.com/api/v3/song/detail`, data, { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy, diff --git a/package.json b/package.json index d14cadf..ce14eed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "4.0.11", + "version": "4.0.12", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", diff --git a/public/home.html b/public/home.html new file mode 100644 index 0000000..1459dc9 --- /dev/null +++ b/public/home.html @@ -0,0 +1,58 @@ + + + + + + + home + + + + + + + + diff --git a/public/login.html b/public/login.html new file mode 100644 index 0000000..1aa597d --- /dev/null +++ b/public/login.html @@ -0,0 +1,47 @@ + + + + + + + 登录 + + + + + + + + -- GitLab