diff --git a/CHANGELOG.MD b/CHANGELOG.MD index f682632a4040335abd5709aeb99e29fad4621b79..796706fa59b0f82bdc28eb4b667fb046a76bc166 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 fa11ff00d71e0c72d61ce8cadbdf47592d75e864..e191c4832f051adb0f5f13e996495532b0c31817 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 3b5873b83cc7ae819d8e8c01da8ef3071db63652..6f16dbc10c412729ff7340ad7a0490da46bf632f 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 0000000000000000000000000000000000000000..e9e1f3eb60610870a2d93e324cc35fc7e9ff7298 --- /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 0000000000000000000000000000000000000000..6a900dac513361ac48c26cd7806765c03ebede86 --- /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 0000000000000000000000000000000000000000..94a62cfe8becf6678411bf1670bb4052d7da4cb9 --- /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 0000000000000000000000000000000000000000..3351c0f546e7123f5b1483b27dc0c225d8a8a0bb --- /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 0000000000000000000000000000000000000000..654ffd48cef660dce395433d8a8c40846dcf9161 --- /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 4029d971a9b882dbfef510c8d0abeef9e31273f2..6ab25ea447bbf97b0e03b8f0306bb32d95401eff 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 0000000000000000000000000000000000000000..56a9474ce9eafd83bc3e2ba08c95897bc8395726 --- /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 56ef2197f1ac6e70a383c93bdc6990b6f9a65e7b..0000000000000000000000000000000000000000 --- 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 084b75e50f87bf2b4d33b19175a4cfd8a9781729..bae702a19f677f9b1d9682c9e3acb2c61d802e60 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",