From bf8f98d7269d7f4f0a203334b054528f1e4539e2 Mon Sep 17 00:00:00 2001 From: binaryify Date: Fri, 9 Apr 2021 10:28:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E8=AF=84=E8=AE=BA=E6=8E=A5=E5=8F=A3=20#1197?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.MD | 3 +++ docs/README.md | 16 ++++++++++++++++ interface.d.ts | 8 ++++++++ module/user_comment_history.js | 22 ++++++++++++++++++++++ package.json | 2 +- 5 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 module/user_comment_history.js diff --git a/CHANGELOG.MD b/CHANGELOG.MD index da5788f..815dc92 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 8626543..762d6a5 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 677be8b..011fe00 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 0000000..bb98221 --- /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 bbb92ce..edf9897 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", -- GitLab