diff --git a/module/comment_add.js b/module/comment_add.js new file mode 100644 index 0000000..4d1244c --- /dev/null +++ b/module/comment_add.js @@ -0,0 +1,15 @@ +// 对某一首歌曲发表评论 + +const createOption = require('../util/option.js') +module.exports = (query, request) => { + const data = { + threadId: 'R_SO_4_' + query.id, + content: query.content, + resourceType: '0', + resourceId: '0', + expressionPicId: '-1', + bubbleId: '-1', + checkToken: '', + } + return request('/api/resource/comments/add', data, createOption(query)) +} diff --git a/module/comment_delete.js b/module/comment_delete.js index a89f298..9eb182a 100644 --- a/module/comment_delete.js +++ b/module/comment_delete.js @@ -3,8 +3,8 @@ const createOption = require('../util/option.js') module.exports = (query, request) => { const data = { - commentId: query.commentId, - threadId: query.threadId, + commentId: query.cid, + threadId: 'R_SO_4_' + query.id, } return request(`/api/resource/comments/delete`, data, createOption(query)) } diff --git a/module/comment_reply.js b/module/comment_reply.js index bd863ab..d64e012 100644 --- a/module/comment_reply.js +++ b/module/comment_reply.js @@ -3,7 +3,7 @@ const createOption = require('../util/option.js') module.exports = (query, request) => { const data = { - threadId: query.threadId, + threadId: query.id, commentId: query.commentId, content: query.content, resourceType: '0', diff --git a/module/user_followeds.js b/module/user_followeds.js index 397ca13..992886f 100644 --- a/module/user_followeds.js +++ b/module/user_followeds.js @@ -5,7 +5,7 @@ module.exports = (query, request) => { const data = { userId: query.uid, time: '0', - limit: query.limit || 30, + limit: query.limit || 20, offset: query.offset || 0, getcounts: 'true', } diff --git a/package.json b/package.json index ac3f0b4..3770b01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neteasecloudmusicapienhanced/api", - "version": "4.30.2", + "version": "4.30.3", "description": "全网最全的网易云音乐API接口 || A revival project for NeteaseCloudMusicApi Node.js Services (Half Refactor & Enhanced) || 网易云音乐 API 备份 + 增强 || 本项目自原版v4.28.0版本后开始自行维护", "scripts": { "dev": "nodemon app.js", diff --git a/public/docs/home.md b/public/docs/home.md index 75dc8b5..31f653a 100644 --- a/public/docs/home.md +++ b/public/docs/home.md @@ -783,7 +783,7 @@ tags: 歌单标签 **必选参数 :** `uid` : 用户 id **可选参数 :** -`limit` : 返回数量 , 默认为 30 +`limit` : 返回数量 , 默认为 20 `offset` : 偏移数量,用于分页 ,如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0 @@ -5111,25 +5111,37 @@ let data = encodeURIComponent( **必选参数 :** -`threadId`: 评论线程 id, 可通过获取评论接口返回结果的`threadId`参数获取 -`commentId`: 回复评论 id, 若为回复评论则必填 +`id`: 歌曲id `content`: 评论内容 -**接口地址 :** `/comment/reply` +**接口地址 :** `/comment/add` -**调用例子 :** `/comment/reply?threadId=R_SO_4_2058263032&content=这首歌太棒了!` +**调用例子 :** `/comment/add?id=2058263032&content=这首歌太棒了!` ### 删除评论 说明 : 登录后调用此接口, 传入评论 id, 删除评论 **必选参数 :** -`commentId`: 评论 id -`threadId`: 评论线程 id, 可通过获取评论接口返回结果的`threadId`参数获取 +`cid`: 评论 id +`id`: 歌曲id **接口地址 :** `/comment/delete` -**调用例子 :** `/comment/delete?threadId=R_SO_4_2058263032&commentId=123456789` +**调用例子 :** `/comment/delete?threadId=2058263032&commentId=123456789` + +### 回复评论 + +说明 : 登录后调用此接口, 传入歌曲 id, 回复内容等信息, 回复评论 + +**必选参数 :** +`id`: 歌曲id +`commentId`: 被回复的评论 id +`content`: 回复内容 + +**接口地址 :** `/comment/reply` + +**调用例子 :** `/comment/reply?id=2058263032&commentId=123456789&content=我也觉得这首歌很棒!` ## 离线访问此文档