diff --git a/docs/README.md b/docs/README.md index 98ae7ee7abb2cacd86e26d89fd4603a22d289669..957a5d333f97000336cbd5a9a506f4ff874adae1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1277,7 +1277,7 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具 **必选参数** - `t`:1 发送 + `t`:1 发送, 2 回复 `tpye`: 数字,资源类型,对应歌曲,mv,专辑,歌单,电台,视频对应以下类型 @@ -1301,6 +1301,8 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具 `content` :要发送的内容 + `commentId` :回复的评论id + **调用例子** : `/comment?t=1&type=1&id=5436712&content=test` (往广岛之恋 mv 发送评论: test) 注意:如给动态发送评论,则不需要传 id,需要传动态的 `threadId`,如:`/comment?t=1&type=6&threadId=A_EV_2_6559519868_32953014&content=test` diff --git a/module/comment.js b/module/comment.js index 2ca5cf4697e91ccd5ad476cbad232b1cfdadaf42..dc1bb3309299b1c7c144d43a5f3546ec4d4e19eb 100644 --- a/module/comment.js +++ b/module/comment.js @@ -2,7 +2,11 @@ module.exports = (query, request) => { query.cookie.os = 'pc' - query.t = (query.t == 1 ? 'add' : 'delete') + query.t = { + 1: 'add', + 0: 'delete', + 2: 'reply' + }[query.t] query.type = { 0: 'R_SO_4_', // 歌曲 1: 'R_MV_5_', // MV @@ -23,6 +27,10 @@ module.exports = (query, request) => { data.content = query.content else if(query.t == 'delete') data.commentId = query.commentId + else if (query.t == 'reply') { + data.commentId = query.commentId + data.content = query.content + } return request( 'POST', `https://music.163.com/weapi/resource/comments/${query.t}`, data, {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}