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

Commit

Permalink
v3.18.1评论接口增加 before 参数以获取超过5000条评论数据 #521 修复 /msg/comments 传入参数和…
Browse files Browse the repository at this point in the history
…文档描述不一致问题
  • Loading branch information
Binaryify committed Jun 30, 2019
1 parent 6bc08d9 commit ec14001
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 27 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# 更新日志
### 3.18.1 | 2019.06.30
- 评论接口增加 `before` 参数以获取超过5000条评论数据 [#521](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/521)

- 修复 `/msg/comments` 传入参数和文档描述不一致问题


### 3.18.0 | 2019.06.29
- 新增 `更换绑定手机接口`

Expand Down
30 changes: 24 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,9 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具

**可选参数 :** `limit`: 取出评论数量 , 默认为 20

`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值
`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值

`before`: 分页参数,取上一页最后一项的 `time` 获取下一页数据(获取超过5000条评论的时候需要用到)

**接口地址 :** `/comment/music`

Expand All @@ -1030,7 +1032,9 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具

**可选参数 :** `limit`: 取出评论数量 , 默认为 20

`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值
`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值

`before`: 分页参数,取上一页最后一项的 `time` 获取下一页数据(获取超过5000条评论的时候需要用到)

**接口地址 :** `/comment/album`

Expand All @@ -1045,7 +1049,9 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具

**可选参数 :** `limit`: 取出评论数量 , 默认为 20

`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值
`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值

`before`: 分页参数,取上一页最后一项的 `time` 获取下一页数据(获取超过5000条评论的时候需要用到)

**接口地址 :** `/comment/playlist`

Expand All @@ -1060,7 +1066,9 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具

**可选参数 :** `limit`: 取出评论数量 , 默认为 20

`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值
`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值

`before`: 分页参数,取上一页最后一项的 `time` 获取下一页数据(获取超过5000条评论的时候需要用到)

**接口地址 :** `/comment/mv`

Expand All @@ -1075,7 +1083,9 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具

**可选参数 :** `limit`: 取出评论数量 , 默认为 20

`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值
`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值

`before`: 分页参数,取上一页最后一项的 `time` 获取下一页数据(获取超过5000条评论的时候需要用到)

**接口地址 :** `/comment/dj`

Expand All @@ -1090,7 +1100,9 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具

**可选参数 :** `limit`: 取出评论数量 , 默认为 20

`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值
`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值

`before`: 分页参数,取上一页最后一项的 `time` 获取下一页数据(获取超过5000条评论的时候需要用到)

**接口地址 :** `/comment/video`

Expand Down Expand Up @@ -1120,6 +1132,12 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具
5: 视频
```

**可选参数 :** `limit`: 取出评论数量 , 默认为 20

`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*20, 其中 20 为 limit 的值

`before`: 分页参数,取上一页最后一项的 `time` 获取下一页数据(获取超过5000条评论的时候需要用到)

**接口地址 :** `/comment/hot`

**调用例子 :** `/comment/hot?id=186016&type=0`
Expand Down
3 changes: 2 additions & 1 deletion module/comment_album.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module.exports = (query, request) => {
const data = {
rid: query.id,
limit: query.limit || 20,
offset: query.offset || 0
offset: query.offset || 0,
beforeTime: query.before || 0
}
return request(
'POST', `https://music.163.com/weapi/v1/resource/comments/R_AL_3_${query.id}`, data,
Expand Down
3 changes: 2 additions & 1 deletion module/comment_dj.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module.exports = (query, request) => {
const data = {
rid: query.id,
limit: query.limit || 20,
offset: query.offset || 0
offset: query.offset || 0,
beforeTime: query.before|| 0
}
return request(
'POST', `https://music.163.com/weapi/v1/resource/comments/A_DJ_1_${query.id}`, data,
Expand Down
3 changes: 2 additions & 1 deletion module/comment_event.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = (query, request) => {
const data = {
limit: query.limit || 20,
offset: query.offset || 0
offset: query.offset || 0,
beforeTime: query.before|| 0
};
return request(
"POST",
Expand Down
3 changes: 2 additions & 1 deletion module/comment_hot.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ module.exports = (query, request) => {
const data = {
rid: query.id,
limit: query.limit || 20,
offset: query.offset || 0
offset: query.offset || 0,
beforeTime: query.before|| 0
}
return request(
'POST', `https://music.163.com/weapi/v1/resource/hotcomments/${query.type}${query.id}`, data,
Expand Down
25 changes: 14 additions & 11 deletions module/comment_music.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// 歌曲评论

module.exports = (query, request) => {
query.cookie.os = 'pc'
const data = {
rid: query.id,
limit: query.limit || 20,
offset: query.offset || 0
}
return request(
'POST', `https://music.163.com/api/v1/resource/comments/R_SO_4_${query.id}`, data,
{crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}
)
}
query.cookie.os = "pc";
const data = {
rid: query.id,
limit: query.limit || 20,
offset: query.offset || 0,
beforeTime: query.before|| 0
};
return request(
"POST",
`https://music.163.com/api/v1/resource/comments/R_SO_4_${query.id}`,
data,
{ crypto: "weapi", cookie: query.cookie, proxy: query.proxy }
);
};
3 changes: 2 additions & 1 deletion module/comment_mv.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module.exports = (query, request) => {
const data = {
rid: query.id,
limit: query.limit || 20,
offset: query.offset || 0
offset: query.offset || 0,
beforeTime: query.before|| 0
}
return request(
'POST', `https://music.163.com/weapi/v1/resource/comments/R_MV_5_${query.id}`, data,
Expand Down
3 changes: 2 additions & 1 deletion module/comment_playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module.exports = (query, request) => {
const data = {
rid: query.id,
limit: query.limit || 20,
offset: query.offset || 0
offset: query.offset || 0,
beforeTime: query.before|| 0
}
return request(
'POST', `https://music.163.com/weapi/v1/resource/comments/A_PL_0_${query.id}`, data,
Expand Down
3 changes: 2 additions & 1 deletion module/comment_video.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module.exports = (query, request) => {
const data = {
rid: query.id,
limit: query.limit || 20,
offset: query.offset || 0
offset: query.offset || 0,
beforeTime: query.before|| 0
}
return request(
'POST', `https://music.163.com/weapi/v1/resource/comments/R_VI_62_${query.id}`, data,
Expand Down
4 changes: 2 additions & 2 deletions module/msg_comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

module.exports = (query, request) => {
const data = {
beforeTime: query.beforeTime || "-1",
beforeTime: query.before || "-1",
limit: query.limit || 30,
total: "true",
uid: query.uid
};
// 448109360

return request(
"POST",
`https://music.163.com/api/v1/user/comments/${query.uid}`,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "NeteaseCloudMusicApi",
"version": "3.18.0",
"version": "3.18.1",
"description": "网易云音乐 NodeJS 版 API",
"scripts": {
"start": "node app.js",
Expand Down

0 comments on commit ec14001

Please sign in to comment.