From 047c3bb0bc52f86a75276ff51c5d8b89bfcf3d76 Mon Sep 17 00:00:00 2001 From: binaryify Date: Sun, 23 Aug 2020 19:52:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E`cloudsearch`=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20#893,=20`mv=20=E5=9C=B0=E5=9D=80`=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E8=BE=A8=E7=8E=87=E5=8F=82=E6=95=B0?= =?UTF-8?q?=20#883,=20=E4=BF=AE=E5=A4=8D=E6=96=B0=E7=A2=9F=E4=B8=8A?= =?UTF-8?q?=E6=9E=B6=E6=8E=A5=E5=8F=A3=E5=88=86=E9=A1=B5=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20#892?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.MD | 5 +++++ docs/README.md | 10 ++++++---- module/cloudsearch.js | 16 ++++++++++++++++ module/mv_url.js | 2 +- module/top_album.js | 2 ++ package.json | 2 +- 6 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 module/cloudsearch.js diff --git a/CHANGELOG.MD b/CHANGELOG.MD index c0361ed..0cc8a06 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,9 @@ # 更新日志 +### 3.39.0 | 2020.08.23 +- 新增`cloudsearch`接口[#893](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/893) +- `mv 地址`接口修改分辨率参数 [#883](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/883) +- 修复新碟上架接口分页问题 [#892](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/892) + ### 3.38.0 | 2020.08.09 - 新增`歌曲楼层评论`,`歌手全部歌曲`接口 [#864](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/864) [#867](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/867) - 支持收藏VIP或付费歌曲到歌单 [#860](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/860) diff --git a/docs/README.md b/docs/README.md index e96492e..69d1742 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1101,9 +1101,9 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具 `type`: 搜索类型;默认为 1 即单曲 , 取值意义 : 1: 单曲, 10: 专辑, 100: 歌手, 1000: 歌单, 1002: 用户, 1004: MV, 1006: 歌词, 1009: 电台, 1014: 视频, 1018:综合 -**接口地址 :** `/search` +**接口地址 :** `/search` 或者 `/cloudsearch`(更全) -**调用例子 :** `/search?keywords= 海阔天空` +**调用例子 :** `/search?keywords= 海阔天空` `/cloudsearch?keywords= 海阔天空` 返回数据如下图 : ![搜索音乐](https://raw.githubusercontent.com/Binaryify/NeteaseCloudMusicApi/master/static/%E6%90%9C%E7%B4%A2.png) @@ -2121,13 +2121,15 @@ MV 点赞转发评论数数据 说明 : 调用此接口 , 传入 mv id,可获取 mv 播放地址 -**可选参数 :** `id`: mv id +**必选参数 :** `id`: mv id + +**可选参数 :** `r`: 分辨率,默认1080,可从 `/mv/detail` 接口获取分辨率列表 **接口地址 :** `/mv/url` **调用例子 :** -`/mv/url?id=5436712` +`/mv/url?id=5436712` `/mv/url?id=10896407&r=1080` ### 获取视频标签列表 说明 : 调用此接口 , 可获取视频标签列表 diff --git a/module/cloudsearch.js b/module/cloudsearch.js new file mode 100644 index 0000000..82fca37 --- /dev/null +++ b/module/cloudsearch.js @@ -0,0 +1,16 @@ +// 搜索 + +module.exports = (query, request) => { + const data = { + s: query.keywords, + type: query.type || 1, // 1: 单曲, 10: 专辑, 100: 歌手, 1000: 歌单, 1002: 用户, 1004: MV, 1006: 歌词, 1009: 电台, 1014: 视频 + limit: query.limit || 30, + offset: query.offset || 0, + } + return request('POST', `https://music.163.com/weapi/cloudsearch/get/web`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/mv_url.js b/module/mv_url.js index b8e7783..3a0fadd 100644 --- a/module/mv_url.js +++ b/module/mv_url.js @@ -3,7 +3,7 @@ module.exports = (query, request) => { const data = { id: query.id, - r: query.res || 1080, + r: query.r || 1080, } return request( 'POST', diff --git a/module/top_album.js b/module/top_album.js index f467bb8..960e7d3 100644 --- a/module/top_album.js +++ b/module/top_album.js @@ -10,6 +10,8 @@ module.exports = (query, request) => { type: query.type || 'new', year: query.year || date.getFullYear(), month: query.month || date.getMonth() + 1, + total: false, + rcmd: false } return request( 'POST', diff --git a/package.json b/package.json index fe9e15c..2a1bdae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "3.38.0", + "version": "3.39.0", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", -- GitLab