diff --git a/CHANGELOG.MD b/CHANGELOG.MD index da5788f57b404733006c26c472117709c96476b9..815dc9290d0cd79d9b55eb41375e007c3ff1b99e 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,7 @@ # 更新日志 +### 4.0.10 | 2021.4.09 +- 新增用户历史评论接口 [#1197](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1197) + ### 4.0.9 | 2021.3.13 - 新增一起听状态接口 [#1170](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1170) diff --git a/docs/README.md b/docs/README.md index 8626543cb09aaff7664ce3ae4d80c37cff2d4c23..762d6a54560c35ec9f5e43ad0cb02287fdadf828 100644 --- a/docs/README.md +++ b/docs/README.md @@ -220,6 +220,7 @@ 202. 歌单详情动态 203. 绑定手机 204. 一起听状态 +205. 用户历史评论 ## 安装 @@ -819,6 +820,21 @@ tags: 歌单标签 **调用例子 :** `/song/order/update?pid=2039116066&ids=[5268328,1219871]` +### 获取用户历史评论 + +说明 : 登录后调用此接口 , 传入用户 id, 可以获取用户历史评论 + +**必选参数 :** `uid` : 用户 id + +**可选参数 :** +`limit` : 返回数量 , 默认为 10 + +`time`: 上一条数据的time,第一页不需要传,默认为0 + +**接口地址 :** `/user/comment/history` + +**调用例子 :** `/user/comment/history?uid=32953014` `/user/comment/history?uid=32953014&limit=1&time=1616217577564` (需要换成自己的用户id) + ### 获取用户电台 说明 : 登录后调用此接口 , 传入用户 id, 可以获取用户电台 diff --git a/interface.d.ts b/interface.d.ts index 677be8bca88d958293b04a430a1b33d7cee5dbea..011fe006e15f84845df8ef10d2dcc4a981a294dc 100644 --- a/interface.d.ts +++ b/interface.d.ts @@ -1409,3 +1409,11 @@ export function user_bindingcellphone( export function listen_together_status( params: RequestBaseConfig, ): Promise + +export function user_comment_history( + params: { + limit?: number | string + uid: number | string + time?: number | string + } & RequestBaseConfig, +): Promise diff --git a/module/user_comment_history.js b/module/user_comment_history.js new file mode 100644 index 0000000000000000000000000000000000000000..bb982214b842b2ef5085fbf43b7ee9949f602e49 --- /dev/null +++ b/module/user_comment_history.js @@ -0,0 +1,22 @@ +module.exports = (query, request) => { + query.cookie.os = 'ios' + query.cookie.appver = '8.1.20' + const data = { + compose_reminder: 'true', + compose_hot_comment: 'true', + limit: query.limit || 10, + user_id: query.uid, + time: query.time || 0, + } + return request( + 'POST', + `https://music.163.com/api/comment/user/comment/history`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }, + ) +} diff --git a/package.json b/package.json index bbb92ce586c292b1f73dee368a5a0eba0ed2a326..edf98976d4d7b26842f6df4dec35b6b12cf26a10 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "4.0.9", + "version": "4.0.10", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js",