From c8d456add75154592ce0dc123fa813e4240b03c8 Mon Sep 17 00:00:00 2001 From: binaryify Date: Fri, 3 May 2019 23:44:06 +0800 Subject: [PATCH] =?UTF-8?q?v3.9.0=20=E6=96=B0=E5=A2=9E=20=E4=BA=91?= =?UTF-8?q?=E7=9B=98=E6=AD=8C=E6=9B=B2=E5=88=A0=E9=99=A4,=20=E7=83=AD?= =?UTF-8?q?=E9=97=A8=E8=AF=9D=E9=A2=98,=20=E7=94=B5=E5=8F=B0=20-=20?= =?UTF-8?q?=E6=8E=A8=E8=8D=90=E7=B1=BB=E5=9E=8B,=20=E7=94=B5=E5=8F=B0=20-?= =?UTF-8?q?=20=E9=9D=9E=E7=83=AD=E9=97=A8=E7=B1=BB=E5=9E=8B,=20=E7=94=B5?= =?UTF-8?q?=E5=8F=B0=20-=20=E4=BB=8A=E6=97=A5=E4=BC=98=E9=80=89,=20?= =?UTF-8?q?=E5=BF=83=E5=8A=A8=E6=A8=A1=E5=BC=8F/=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E7=AD=89=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.MD | 5 ++ docs/README.md | 100 +++++++++++++++++++++++++-- docs/index.html | 1 + module/banner.js | 8 ++- module/dj_banner.js | 11 +++ module/dj_category_excludehot.js | 9 +++ module/dj_category_recommend.js | 9 +++ module/dj_paygift.js | 2 +- module/dj_today_perfered.js | 11 +++ module/event.js | 6 +- module/hot_topic.js | 12 ++++ module/playmode_intelligence_list.js | 17 +++++ module/user_cloud_del.js | 12 ++++ package.json | 2 +- 14 files changed, 196 insertions(+), 9 deletions(-) create mode 100644 module/dj_banner.js create mode 100644 module/dj_category_excludehot.js create mode 100644 module/dj_category_recommend.js create mode 100644 module/dj_today_perfered.js create mode 100644 module/hot_topic.js create mode 100644 module/playmode_intelligence_list.js create mode 100644 module/user_cloud_del.js diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 80d59ac..8ef1f7b 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,9 @@ # 更新日志 +### 3.9.0 | 2019.05.03 +- 新增 云盘歌曲删除, 热门话题, 电台 - 推荐类型, 电台 - 非热门类型, 电台 - 今日优选, 心动模式/智能播放等接口 + +- 更新文档:banner接口 增加 `type` 参数; 获取动态消息接口增加 `pagesize` 和 `lasttime` 参数; 电台 - 付费精选接口修改默认`limit`为 30 + ### 3.8.1 | 2019.04.24 - 修复歌词接口出错问题 diff --git a/docs/README.md b/docs/README.md index 8d7774e..6f160d6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -114,6 +114,13 @@ 96. 已收藏专辑列表 97. 获取动态评论 98. 歌单收藏者列表 +99. 云盘歌曲删除 +100. 热门话题 +101. 电台 - 推荐类型 +102. 电台 - 非热门类型 +103. 电台 - 今日优选 +104. 心动模式/智能播放 + ## 安装 @@ -524,16 +531,44 @@ tags:歌单tag **调用例子 :** `/user/record?uid=32953014&type=1` +### 获取热门话题 + +说明 : 调用此接口 , 可获取热门话题 + +**可选参数 :** `limit`: 取出评论数量 , 默认为 20 + +`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值 + +**接口地址 :** `/act/hot` + +**调用例子 :** `/act/hot?limit=30&offset=30` + +### 心动模式/智能播放 +说明 : 调用此接口 , 可获取心动模式/智能播放列表 +**必选参数 :** `id` : 歌曲 id + +`pid` : 歌单 id + +**可选参数 :** +`sid` : 要开始播放的歌曲的 id + +**接口地址 :** `/playmode/intelligence/list` + +**调用例子 :** `/playmode/intelligence/list?id=33894312&pid=24381616` , `/playmode/intelligence/list?id=33894312&pid=24381616&sid=36871368` + ### 获取动态消息 说明 : 调用此接口 , 可获取各种动态 , 对应网页版网易云,朋友界面里的各种动态消息 ,如分享的视频,音乐,照片等! -**必选参数 :** 未知 +**必选参数 :** +`pagesize` : 每页数据,默认20 + +`lasttime` : 返回数据的 `lasttime` ,默认-1,传入上一次返回结果的 lasttime,将会返回下一页的数据 **接口地址 :** `/event` -**调用例子 :** `/event` +**调用例子 :** `/event?pagesize=30&lasttime=1556740526369` ### 歌手分类列表 @@ -1142,9 +1177,23 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具 说明 : 调用此接口 , 可获取 banner( 轮播图 ) 数据 +**可选参数 :** + +`type`:资源类型,对应以下类型,默认为 0 即PC + +``` +0: pc + +1: android + +2: iphone + +3: ipad +``` + **接口地址 :** `/banner` -**调用例子 :** `/banner` +**调用例子 :** `/banner`, `/banner?type=2` ### 资源点赞( MV,电台,视频) @@ -1706,6 +1755,15 @@ MV 数据 , 数据包含 mv 名字 , 歌手 , 发布时间 , mv 视频地址等 **调用例子 :** `/user/cloud` +### 云盘歌曲删除 +说明 : 登陆后调用此接口 , 可删除云盘歌曲 + +**必选参数 :** `id`: 歌曲id,可多个,用逗号隔开 + +**接口地址 :** `/user/cloud/del` + +**调用例子 :** `/user/cloud/del` + ### 电台 - 推荐 说明 : 登陆后调用此接口 , 可获得推荐电台 @@ -1757,10 +1815,43 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009` 说明 : 可以获取付费精选的电台列表 , 传入 `limit` 和 `offset` 可以进行分页 +**可选参数 :** + +`limit` : 返回数量 , 默认为 30 + +`offset` : 偏移数量,用于分页 , 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0 + **接口地址 :** `/dj/paygift` **调用例子 :** `/dj/paygift?limit=10&offset=20` +### 电台 - 非热门类型 + +说明 : 登陆后调用此接口, 可获得电台非热门类型 + + +**接口地址 :** `/dj/category/excludehot` + +**调用例子 :** `/dj/category/excludehot` + +### 电台 - 推荐类型 + +说明 : 登陆后调用此接口, 可获得电台推荐类型 + + +**接口地址 :** `/dj/category/recommend` + +**调用例子 :** `/dj/category/recommend` + +### 电台 - 今日优选 + +说明 : 登陆后调用此接口, 可获得电台今日优选 + + +**接口地址 :** `/dj/today/perfered` + +**调用例子 :** `/dj/today/perfered` + ### 电台 - 详情 说明 : 登陆后调用此接口 , 传入`rid`, 可获得对应电台的详情介绍 @@ -1784,8 +1875,7 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009` `limit` : 返回数量 , 默认为 30 -`offset` : 偏移数量,用于分页 , 如 -: 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0 +`offset` : 偏移数量,用于分页 , 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0 `asc` : 排序方式,默认为 `false` (新 => 老 ) 设置 `true` 可改为 老 => 新 diff --git a/docs/index.html b/docs/index.html index 1496390..45a6b59 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,6 +8,7 @@ + diff --git a/module/banner.js b/module/banner.js index 9a0148d..11cab05 100644 --- a/module/banner.js +++ b/module/banner.js @@ -1,8 +1,14 @@ // 首页轮播图 module.exports = (query, request) => { + const type = { + 0: 'pc', + 1: 'android', + 2: 'iphone', + 3: 'ipad' + }[query.type || 0] || 'pc'; return request( - 'POST', `https://music.163.com/api/v2/banner/get`, {clientType: "pc"}, + 'POST', `https://music.163.com/api/v2/banner/get`, {clientType: type}, {crypto: 'linuxapi', proxy: query.proxy} ) } \ No newline at end of file diff --git a/module/dj_banner.js b/module/dj_banner.js new file mode 100644 index 0000000..898507c --- /dev/null +++ b/module/dj_banner.js @@ -0,0 +1,11 @@ +// 电台banner + +module.exports = (query, request) => { + const data = {}; + return request( + "POST", + `http://music.163.com/weapi/djradio/banner/get`, + {}, + { crypto: "weapi", cookie: query.cookie, proxy: query.proxy } + ); +}; diff --git a/module/dj_category_excludehot.js b/module/dj_category_excludehot.js new file mode 100644 index 0000000..6cc2de2 --- /dev/null +++ b/module/dj_category_excludehot.js @@ -0,0 +1,9 @@ +// dj非热门类型 + +module.exports = (query, request) => { + + return request( + 'POST', `http://music.163.com/weapi/djradio/category/excludehot`, {}, + {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + ) +}; \ No newline at end of file diff --git a/module/dj_category_recommend.js b/module/dj_category_recommend.js new file mode 100644 index 0000000..0c55719 --- /dev/null +++ b/module/dj_category_recommend.js @@ -0,0 +1,9 @@ +// dj推荐类型 + +module.exports = (query, request) => { + + return request( + 'POST', `http://music.163.com/weapi/djradio/home/category/recommend`, {}, + {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + ) +}; \ No newline at end of file diff --git a/module/dj_paygift.js b/module/dj_paygift.js index 7a25503..ae7e6b7 100644 --- a/module/dj_paygift.js +++ b/module/dj_paygift.js @@ -2,7 +2,7 @@ module.exports = (query, request) => { const data = { - limit: query.limit || 10, + limit: query.limit || 30, offset: query.offset || 0 } return request( diff --git a/module/dj_today_perfered.js b/module/dj_today_perfered.js new file mode 100644 index 0000000..f0438dd --- /dev/null +++ b/module/dj_today_perfered.js @@ -0,0 +1,11 @@ +// dj今日优选 + +module.exports = (query, request) => { + const data = { + page: query.page || 0 + }; + return request( + 'POST', `http://music.163.com/weapi/djradio/home/today/perfered`, data, + {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + ) +}; \ No newline at end of file diff --git a/module/event.js b/module/event.js index ec6284b..aab886e 100644 --- a/module/event.js +++ b/module/event.js @@ -1,8 +1,12 @@ // 动态 module.exports = (query, request) => { + const data={ + "pagesize": query.pagesize || 20, + "lasttime": query.lasttime || -1 + } return request( - 'POST', `https://music.163.com/weapi/v1/event/get`, {}, + 'POST', `https://music.163.com/weapi/v1/event/get`, data, {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} ) } \ No newline at end of file diff --git a/module/hot_topic.js b/module/hot_topic.js new file mode 100644 index 0000000..c1889ba --- /dev/null +++ b/module/hot_topic.js @@ -0,0 +1,12 @@ +//热门话题 + +module.exports = (query, request) => { + const data = { + limit: query.limit || 20, + offset: query.offset || 0 + } + return request( + 'POST', `http://music.163.com/weapi/act/hot`, data, + {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + ) +}; \ No newline at end of file diff --git a/module/playmode_intelligence_list.js b/module/playmode_intelligence_list.js new file mode 100644 index 0000000..470cd69 --- /dev/null +++ b/module/playmode_intelligence_list.js @@ -0,0 +1,17 @@ +// 智能播放 + +module.exports = (query, request) => { + const data = { + songId: query.id, + type: "fromPlayOne", + playlistId: query.pid, + startMusicId: query.sid || query.id, + count: query.count || 1 + }; + return request( + "POST", + `http://music.163.com/weapi/playmode/intelligence/list`, + data, + { crypto: "weapi", cookie: query.cookie, proxy: query.proxy } + ); +}; diff --git a/module/user_cloud_del.js b/module/user_cloud_del.js new file mode 100644 index 0000000..b2a564d --- /dev/null +++ b/module/user_cloud_del.js @@ -0,0 +1,12 @@ +// 云盘歌曲删除 + +module.exports = (query, request) => { + const data = { + songIds: [query.id] + }; + return request("POST", `http://music.163.com/weapi/cloud/del`, data, { + crypto: "weapi", + cookie: query.cookie, + proxy: query.proxy + }); +}; diff --git a/package.json b/package.json index f530710..a581e6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "3.8.1", + "version": "3.9.0", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js",