From b1ebbf51bed3d92ec8623de0794be26f12a03c6e Mon Sep 17 00:00:00 2001 From: jsososo Date: Wed, 11 Sep 2019 19:38:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 4 +++- module/comment.js | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/README.md b/docs/README.md index 98ae7ee7abb..957a5d333f9 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 2ca5cf4697e..dc1bb330929 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}