diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 651a5fdb3b78a415b993dce2860047e2b7808ffb..7246b032b37db301b9d06ce3bc80059da28f93d8 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,10 +1,19 @@ # 更新日志 +### 4.1.0 | 2021.11.20 + +- 修复新版评论返回参数错误问题 [#1393](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1393) [#1377](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1377) + +- 新增获取歌单所有歌曲的 API [#1397](https://github.com/Binaryify/NeteaseCloudMusicApi/pull/1397) + +- 新增发送文本动态接口, 获取客户端歌曲下载链接 url 接口 [#1391](https://github.com/Binaryify/NeteaseCloudMusicApi/pull/1391) + + ### 4.0.23 | 2021.9.15 - 修复文件上传设置问题 [#1355](https://github.com/Binaryify/NeteaseCloudMusicApi/pull/1355) -- 修复interface不完整问题 [#1356](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1356) +- 修复 interface 不完整问题 [#1356](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1356) ### 4.0.22 | 2021.9.08 diff --git a/docs/README.md b/docs/README.md index 76ca0ec33f20e9c6b3939cab0fdc74d6c4b2fcb3..0336868a395369f2b6efa9ec9c4548d91ab18380 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1748,7 +1748,7 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具 `pageSize`:分页参数,每页多少条数据,默认20 -`sortType`: 排序方式,1:按推荐排序,2:按热度排序,3:按时间排序 +`sortType`: 排序方式, 1:按推荐排序, 2:按热度排序, 3:按时间排序 `cursor`: 当`sortType`为3时且页数不是第一页时需传入,值为上一条数据的time @@ -1765,7 +1765,7 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具 `cid` : 评论 id -`t` : 是否点赞 ,1 为点赞 ,0 为取消点赞 +`t` : 是否点赞 , 1 为点赞 ,0 为取消点赞 `type`: 数字 , 资源类型 , 对应歌曲 , mv, 专辑 , 歌单 , 电台, 视频对应以下类型 diff --git a/interface.d.ts b/interface.d.ts index 7e4b6dd2a8f624748ca8f51b2b0377ee4422aa75..fd3bccd72df9e4ee9e8dc325c6605f016541e91e 100644 --- a/interface.d.ts +++ b/interface.d.ts @@ -1534,3 +1534,23 @@ export function musician_cloudbean_obtain( export function vip_info(params: RequestBaseConfig): Promise export function musician_sign(params: RequestBaseConfig): Promise + +export function song_download_url( + params: { + id: number | string + br?: number | string + } & RequestBaseConfig, +): Promise + +export function send_event_text( + params: { + msg: number | string + } & RequestBaseConfig, +): Promise + +export function playlist_track_all( + params: { + id: number | string + s?: number | string + } & RequestBaseConfig, +): Promise diff --git a/module/comment_new.js b/module/comment_new.js index ad3cb0b59cd7405da02ba515b3bb381907f37310..ec221dc8d3d6289c7a2232f1c78ff66816a62f76 100644 --- a/module/comment_new.js +++ b/module/comment_new.js @@ -7,14 +7,31 @@ module.exports = (query, request) => { const threadId = query.type + query.id const pageSize = query.pageSize || 20 const pageNo = query.pageNo || 1 + let sortType = Number(query.sortType) || 99 + if (sortType === 1) { + sortType = 99 + } + let cursor = '' + switch (sortType) { + case 99: + cursor = (pageNo - 1) * pageSize + break + case 2: + cursor = 'normalHot#' + (pageNo - 1) * pageSize + break + case 3: + cursor = query.cursor || '0' + break + default: + break + } const data = { threadId: threadId, pageNo, showInner: query.showInner || true, pageSize, - cursor: - +query.sortType === 3 ? query.cursor || '0' : (pageNo - 1) * pageSize, - sortType: query.sortType || 1, //1:按推荐排序,2:按热度排序,3:按时间排序 + cursor: cursor, + sortType: sortType, //99:按推荐排序,2:按热度排序,3:按时间排序 } return request( 'POST', diff --git a/package.json b/package.json index a4c5a7da0448c0c4183c64b024e502c6a35422d4..203c81c4c708a2a45d8bff0d23f146cceafca241 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "4.0.23", + "version": "4.1.0", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js",