Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

回复评论 #589

Merged
merged 1 commit into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具

**必选参数**

`t`:1 发送
`t`:1 发送, 2 回复

`tpye`: 数字,资源类型,对应歌曲,mv,专辑,歌单,电台,视频对应以下类型

Expand All @@ -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`
Expand Down
10 changes: 9 additions & 1 deletion module/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down