From 46400d930fdc31a21f7555bd9c1b19b60ff35208 Mon Sep 17 00:00:00 2001 From: binaryify Date: Thu, 9 May 2019 16:26:41 +0800 Subject: [PATCH] =?UTF-8?q?v3.11.0=20=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.MD | 3 ++ README.MD | 6 +++ docs/README.md | 86 +++++++++++++++++++++++++++++++++++++ module/msg_comments.js | 21 +++++++++ module/msg_forwards.js | 14 ++++++ module/msg_notices.js | 14 ++++++ module/msg_private.js | 14 ++++++ module/setting.js | 9 ++++ module/user_cloud.js | 2 +- module/user_cloud_detail.js | 14 ++++++ module/user_cloud_search.js | 12 ------ package.json | 2 +- 12 files changed, 183 insertions(+), 14 deletions(-) create mode 100644 module/msg_comments.js create mode 100644 module/msg_forwards.js create mode 100644 module/msg_notices.js create mode 100644 module/msg_private.js create mode 100644 module/setting.js create mode 100644 module/user_cloud_detail.js delete mode 100644 module/user_cloud_search.js diff --git a/CHANGELOG.MD b/CHANGELOG.MD index f682632..796706f 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,7 @@ # 更新日志 +### 3.11.0 | 2019.05.09 +- 增加`通知-私信、通知-评论、通知-@我、通知-通知、设置、云盘数据详情`接口 + ### 3.10.2 | 2019.05.09 - 增加`分享歌曲、歌单、mv、电台、电台节目到动态`接口 diff --git a/README.MD b/README.MD index fa11ff0..e191c48 100644 --- a/README.MD +++ b/README.MD @@ -128,6 +128,12 @@ 105. 转发动态 106. 删除动态 107. 分享歌曲、歌单、mv、电台、电台节目到动态 +108. 通知-私信 +109. 通知-评论 +110. 通知-@我 +111. 通知-通知 +112. 设置 +113. 云盘数据详情 ## 环境要求 diff --git a/docs/README.md b/docs/README.md index 3b5873b..6f16dbc 100644 --- a/docs/README.md +++ b/docs/README.md @@ -123,6 +123,12 @@ 105. 转发动态 106. 删除动态 107. 分享歌曲、歌单、mv、电台、电台节目到动态 +108. 通知-私信 +109. 通知-评论 +110. 通知-@我 +111. 通知-通知 +112. 设置 +113. 云盘数据详情 ## 安装 @@ -1798,6 +1804,16 @@ MV 数据 , 数据包含 mv 名字 , 歌手 , 发布时间 , mv 视频地址等 **调用例子 :** `/user/cloud` +### 云盘数据详情 +说明 : 登陆后调用此接口 , 传入云盘歌曲 id,可获取云盘数据详情 + +**必选参数 :** `id`: 歌曲id,可多个,用逗号隔开 + +**接口地址 :** `/user/cloud/detail` + +**调用例子 :** `/user/cloud/detail?id=5374627` + + ### 云盘歌曲删除 说明 : 登陆后调用此接口 , 可删除云盘歌曲 @@ -1926,6 +1942,76 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009` **调用例子 :** `/dj/program?rid=336355127&limit=40` ( 对应 ' 代码时间 ' 的节目列表 ) + +### 通知 - 私信 + +说明 : 登陆后调用此接口 ,可获取私信 + +**可选参数 :** + +`limit` : 返回数量 , 默认为 30 + +`offset` : 偏移数量,用于分页 , 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0 + +**接口地址 :** `/msg/private` + +**调用例子 :** `/msg/private?limit=3` + + +### 通知 - 评论 + +说明 : 登陆后调用此接口 ,可获取评论 + +**必选参数 :** `uid`: 用户 的 id,只能和登录账号的 id 一致 + +**可选参数 :** + +`limit` : 返回数量 , 默认为 30 + +`before` : 分页参数,取上一页最后一个歌单的 `updateTime` 获取下一页数据 + + +**接口地址 :** `/msg/comments` + +**调用例子 :** `/msg/comments?uid=32953014` + +### 通知 - @我 + +说明 : 登陆后调用此接口 ,可获取@我数据 + +**可选参数 :** + +`limit` : 返回数量 , 默认为 30 + +`offset` : 偏移数量,用于分页 , 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0 + +**接口地址 :** `/msg/forwards` + +**调用例子 :** `/msg/forwards?limit=3` + + +### 通知 - 通知 + +说明 : 登陆后调用此接口 ,可获取通知 + +**可选参数 :** + +`limit` : 返回数量 , 默认为 30 + +`offset` : 偏移数量,用于分页 , 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0 + + +**接口地址 :** `/msg/notices` + +**调用例子 :** `/msg/notices?limit=3` + +### 设置 +说明 : 登陆后调用此接口 ,可获取用户设置 + +**接口地址 :** `/setting` + +**调用例子 :** `/setting` + ## 离线访问此文档 此文档同时也是 Progressive Web Apps(PWA), 加入了 serviceWorker, 可离线访问 diff --git a/module/msg_comments.js b/module/msg_comments.js new file mode 100644 index 0000000..e9e1f3e --- /dev/null +++ b/module/msg_comments.js @@ -0,0 +1,21 @@ +// 评论 + +module.exports = (query, request) => { + const data = { + beforeTime: query.beforeTime || "-1", + limit: query.limit || 30, + total: "true", + uid: query.uid + }; + // 448109360 + return request( + "POST", + `https://music.163.com/api/v1/user/comments/${query.uid}`, + data, + { + crypto: "weapi", + cookie: query.cookie, + proxy: query.proxy + } + ); +}; diff --git a/module/msg_forwards.js b/module/msg_forwards.js new file mode 100644 index 0000000..6a900da --- /dev/null +++ b/module/msg_forwards.js @@ -0,0 +1,14 @@ +// @我 + +module.exports = (query, request) => { + const data = { + offset: query.offset || 0, + limit: query.limit || 30, + total: "true" + }; + return request("POST", `https://music.163.com/api/forwards/get`, data, { + crypto: "weapi", + cookie: query.cookie, + proxy: query.proxy + }); +}; diff --git a/module/msg_notices.js b/module/msg_notices.js new file mode 100644 index 0000000..94a62cf --- /dev/null +++ b/module/msg_notices.js @@ -0,0 +1,14 @@ +// 通知 + +module.exports = (query, request) => { + const data = { + offset: query.offset || 0, + limit: query.limit || 30, + total: "true", + }; + return request("POST", `https://music.163.com/api/msg/notices`, data, { + crypto: "weapi", + cookie: query.cookie, + proxy: query.proxy + }); +}; diff --git a/module/msg_private.js b/module/msg_private.js new file mode 100644 index 0000000..3351c0f --- /dev/null +++ b/module/msg_private.js @@ -0,0 +1,14 @@ +// 私信 + +module.exports = (query, request) => { + const data = { + offset: query.offset || 0, + limit: query.limit || 30, + total: "true", + }; + return request("POST", `https://music.163.com/api/msg/private/users`, data, { + crypto: "weapi", + cookie: query.cookie, + proxy: query.proxy + }); +}; diff --git a/module/setting.js b/module/setting.js new file mode 100644 index 0000000..654ffd4 --- /dev/null +++ b/module/setting.js @@ -0,0 +1,9 @@ +module.exports = (query, request) => { + const data = { + + } + return request( + 'POST', `https://music.163.com/api/user/setting`, data, + {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + ) +} \ No newline at end of file diff --git a/module/user_cloud.js b/module/user_cloud.js index 4029d97..6ab25ea 100644 --- a/module/user_cloud.js +++ b/module/user_cloud.js @@ -2,7 +2,7 @@ module.exports = (query, request) => { const data = { - limit: query.limit || 200, + limit: query.limit || 30, offset: query.offset || 0 } return request( diff --git a/module/user_cloud_detail.js b/module/user_cloud_detail.js new file mode 100644 index 0000000..56a9474 --- /dev/null +++ b/module/user_cloud_detail.js @@ -0,0 +1,14 @@ +// 云盘数据详情 + +module.exports = (query, request) => { + const id = query.id.replace(/\s/g, "").split(","); + const data = { + songIds: id + }; + return request( + "POST", + `https://music.163.com/weapi/v1/cloud/get/byids`, + data, + { crypto: "weapi", cookie: query.cookie, proxy: query.proxy } + ); +}; diff --git a/module/user_cloud_search.js b/module/user_cloud_search.js deleted file mode 100644 index 56ef219..0000000 --- a/module/user_cloud_search.js +++ /dev/null @@ -1,12 +0,0 @@ -// 云盘数据详情(暂时不要使用) - -module.exports = (query, request) => { - const data = { - byids: query.id, - id: query.id - } - return request( - 'POST', `https://music.163.com/weapi/v1/cloud/get/byids`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file diff --git a/package.json b/package.json index 084b75e..bae702a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "3.10.2", + "version": "3.11.0", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", -- GitLab