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

Commit 4018547

Browse files
committed
修复使用post请求取消喜欢音乐会失败的问题 #1024, 新增抱一抱评论和评论抱一抱列表接口 #1016, 新增收藏的专栏接口 #1026
1 parent 99ec5bf commit 4018547

14 files changed

+143
-70
lines changed

CHANGELOG.MD

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# 更新日志
2+
### 3.47.0 | 2020.11.14
3+
- 修复使用post请求取消喜欢音乐会失败的问题 [#1024](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1024)
4+
5+
- 新增抱一抱评论和评论抱一抱列表接口 [#1016](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1016)
6+
7+
- 新增收藏的专栏接口[#1026](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1026)
8+
29
### 3.46.1 | 2020.11.7
310
- 修复私信音乐接口出现风险提示的问题
411

README.MD

+3
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ banner({ type:0 }).then(res=>{
291291
189. 账号信息
292292
190. 最近联系人
293293
191. 私信音乐
294+
192. 抱一抱评论
295+
193. 评论抱一抱列表
296+
194. 收藏的专栏
294297

295298
## 更新日志
296299

docs/README.md

+60
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@
207207
189. 账号信息
208208
190. 最近联系人
209209
191. 私信音乐
210+
192. 抱一抱评论
211+
193. 评论抱一抱列表
212+
194. 收藏的专栏
210213

211214
## 安装
212215

@@ -1037,6 +1040,20 @@ tags: 歌单标签
10371040

10381041
**调用例子 :** `/artist/sublist`
10391042

1043+
### 收藏的专栏
1044+
1045+
说明 : 调用此接口,可获取收藏的专栏
1046+
1047+
**可选参数 :**
1048+
1049+
`limit`: 取出歌单数量 , 默认为 50
1050+
1051+
`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*50, 其中 50 为 limit 的值
1052+
1053+
**接口地址 :** `/topic/sublist`
1054+
1055+
**调用例子 :** `/topic/sublist?limit=2&offset=1`
1056+
10401057
### 收藏视频
10411058

10421059
说明 : 调用此接口,可收藏视频
@@ -1649,6 +1666,49 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具
16491666

16501667
注意: 动态点赞不需要传入 id 参数,需要传入动态的 `threadId` 参数,如:`/comment/like?type=6&cid=1419532712&threadId=A_EV_2_6559519868_32953014&t=0``threadId` 可通过 `/event``/user/event` 接口获取
16511668

1669+
### 抱一抱评论
1670+
1671+
说明 : 调用此接口,可抱一抱评论
1672+
1673+
**必选参数 :**
1674+
1675+
`uid`: 用户id
1676+
1677+
`cid`: 评论id
1678+
1679+
`sid`: 资源id
1680+
1681+
**接口地址 :** `/hug/comment`
1682+
1683+
**调用例子 :** `/hug/comment?uid=285516405&cid=1167145843&sid=863481066`
1684+
1685+
### 评论抱一抱列表
1686+
1687+
说明 : 调用此接口,可获取评论抱一抱列表
1688+
1689+
**必选参数 :**
1690+
1691+
`uid`: 用户id
1692+
1693+
`cid`: 评论id
1694+
1695+
`sid`: 资源id
1696+
1697+
**可选参数 :**
1698+
1699+
`page`: 页数
1700+
1701+
`cursor`: 上一页返回的cursor,默认-1,第一页不需要传
1702+
1703+
`idCursor`: 上一页返回的idCursor,默认-1,第一页不需要传
1704+
1705+
`pageSize` : 每页页数,默认100
1706+
1707+
**接口地址 :** `/comment/hug/list`
1708+
1709+
**调用例子 :** `/comment/hug/list?uid=285516405&cid=1167145843&sid=863481066&pageSize=2&page=1`
1710+
1711+
16521712
### 发送/删除评论
16531713

16541714
说明 : 调用此接口,可发送评论或者删除评论

interface.d.ts

+26
Original file line numberDiff line numberDiff line change
@@ -1307,3 +1307,29 @@ export function yunbei_task_finish(
13071307
depositCode?: number | string
13081308
} & RequestBaseConfig,
13091309
): Promise<Response>
1310+
1311+
export function msg_recentcontact(params: RequestBaseConfig): Promise<Response>
1312+
1313+
export function hug_comment(
1314+
params: {
1315+
uid: number | string
1316+
cid: number | string
1317+
sid: number | string
1318+
} & RequestBaseConfig,
1319+
): Promise<Response>
1320+
1321+
export function comment_hug_list(
1322+
params: {
1323+
page: number | string
1324+
cursor: number | string
1325+
idCursor: number | string
1326+
pageSize?: number | string
1327+
} & RequestBaseConfig,
1328+
): Promise<Response>
1329+
1330+
export function topic_sublist(
1331+
params: {
1332+
limit?: number | string
1333+
offset?: number | string
1334+
} & RequestBaseConfig,
1335+
): Promise<Response>

module/comment.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const { resourceTypeMap } = require('../util/config.json')
12
// 发送与删除评论
23

34
module.exports = (query, request) => {
@@ -7,15 +8,7 @@ module.exports = (query, request) => {
78
0: 'delete',
89
2: 'reply',
910
}[query.t]
10-
query.type = {
11-
0: 'R_SO_4_', // 歌曲
12-
1: 'R_MV_5_', // MV
13-
2: 'A_PL_0_', // 歌单
14-
3: 'R_AL_3_', // 专辑
15-
4: 'A_DJ_1_', // 电台,
16-
5: 'R_VI_62_', // 视频
17-
6: 'A_EV_2_', // 动态
18-
}[query.type]
11+
query.type = resourceTypeMap[query.type]
1912
const data = {
2013
threadId: query.type + query.id,
2114
}

module/comment_floor.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1+
const { resourceTypeMap } = require('../util/config.json')
12
module.exports = (query, request) => {
2-
query.type = {
3-
0: 'R_SO_4_', // 歌曲
4-
1: 'R_MV_5_', // MV
5-
2: 'A_PL_0_', // 歌单
6-
3: 'R_AL_3_', // 专辑
7-
4: 'A_DJ_1_', // 电台,
8-
5: 'R_VI_62_', // 视频
9-
}[query.type]
3+
query.type = resourceTypeMap[query.type]
104
const data = {
115
parentCommentId: query.parentCommentId,
126
threadId: query.type + query.id,

module/comment_hot.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1+
const { resourceTypeMap } = require('../util/config.json')
12
// 热门评论
23

34
module.exports = (query, request) => {
45
query.cookie.os = 'pc'
5-
query.type = {
6-
0: 'R_SO_4_', // 歌曲
7-
1: 'R_MV_5_', // MV
8-
2: 'A_PL_0_', // 歌单
9-
3: 'R_AL_3_', // 专辑
10-
4: 'A_DJ_1_', // 电台,
11-
5: 'R_VI_62_', // 视频
12-
}[query.type]
6+
query.type = resourceTypeMap[query.type]
137
const data = {
148
rid: query.id,
159
limit: query.limit || 20,

module/comment_hug_list.js

+7-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1+
const { resourceTypeMap } = require('../util/config.json')
12
module.exports = (query, request) => {
23
query.cookie.os = 'ios'
34
query.cookie.appver = '7.3.27'
4-
query.type = {
5-
0: 'R_SO_4_', // 歌曲
6-
1: 'R_MV_5_', // MV
7-
2: 'A_PL_0_', // 歌单
8-
3: 'R_AL_3_', // 专辑
9-
4: 'A_DJ_1_', // 电台,
10-
5: 'R_VI_62_', // 视频
11-
6: 'A_EV_2_', // 动态
12-
}[query.type]
13-
const threadId = query.type + query.id
5+
query.type = resourceTypeMap[query.type || 0]
6+
const threadId = query.type + query.sid
147
const data = {
158
targetUserId: query.uid,
169
commentId: query.cid,
17-
cursor: '-1',
10+
cursor: query.cursor || '-1',
1811
threadId: threadId,
19-
pageNo: 1,
20-
idCursor: -1,
21-
pageSize: 100,
12+
pageNo: query.page || 1,
13+
idCursor: query.idCursor || -1,
14+
pageSize: query.pageSize || 100,
2215
}
2316
return request(
2417
'POST',

module/comment_like.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1+
const { resourceTypeMap } = require('../util/config.json')
12
// 点赞与取消点赞评论
23

34
module.exports = (query, request) => {
45
query.cookie.os = 'pc'
56
query.t = query.t == 1 ? 'like' : 'unlike'
6-
query.type = {
7-
0: 'R_SO_4_', // 歌曲
8-
1: 'R_MV_5_', // MV
9-
2: 'A_PL_0_', // 歌单
10-
3: 'R_AL_3_', // 专辑
11-
4: 'A_DJ_1_', // 电台,
12-
5: 'R_VI_62_', // 视频
13-
6: 'A_EV_2_', // 动态
14-
}[query.type]
7+
query.type = resourceTypeMap[query.type]
158
const data = {
169
threadId: query.type + query.id,
1710
commentId: query.cid,

module/comment_new.js

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1+
const { resourceTypeMap } = require('../util/config.json')
12
// 评论
23

34
module.exports = (query, request) => {
45
query.cookie.os = 'pc'
5-
query.type = {
6-
0: 'R_SO_4_', // 歌曲
7-
1: 'R_MV_5_', // MV
8-
2: 'A_PL_0_', // 歌单
9-
3: 'R_AL_3_', // 专辑
10-
4: 'A_DJ_1_', // 电台,
11-
5: 'R_VI_62_', // 视频
12-
6: 'A_EV_2_', // 动态
13-
}[query.type]
6+
query.type = resourceTypeMap[query.type]
147
const threadId = query.type + query.id
158
const pageSize = query.pageSize || 20
169
const pageNo = query.pageNo || 1
1710
const data = {
18-
threadId: threadId, //'R_SO_4_863481066',
11+
threadId: threadId,
1912
pageNo,
2013
showInner: query.showInner || true,
2114
pageSize,

module/hug_comment.js

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1+
const { resourceTypeMap } = require('../util/config.json')
12
module.exports = (query, request) => {
23
query.cookie.os = 'ios'
34
query.cookie.appver = '7.3.27'
4-
query.type = {
5-
0: 'R_SO_4_', // 歌曲
6-
1: 'R_MV_5_', // MV
7-
2: 'A_PL_0_', // 歌单
8-
3: 'R_AL_3_', // 专辑
9-
4: 'A_DJ_1_', // 电台,
10-
5: 'R_VI_62_', // 视频
11-
6: 'A_EV_2_', // 动态
12-
}[query.type]
13-
const threadId = query.type + query.id
5+
query.type = resourceTypeMap[query.type || 0]
6+
const threadId = query.type + query.sid
147
const data = {
158
targetUserId: query.uid,
169
commentId: query.cid,

module/topic_sub_list.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// 收藏的专栏
2+
3+
module.exports = (query, request) => {
4+
const data = {
5+
limit: query.limit || 50,
6+
offset: query.offset || 0,
7+
total: true,
8+
}
9+
return request('POST', `https://music.163.com/api/topic/sublist`, data, {
10+
crypto: 'weapi',
11+
cookie: query.cookie,
12+
proxy: query.proxy,
13+
realIP: query.realIP,
14+
})
15+
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "NeteaseCloudMusicApi",
3-
"version": "3.46.1",
3+
"version": "3.47.0",
44
"description": "网易云音乐 NodeJS 版 API",
55
"scripts": {
66
"start": "node app.js",

util/config.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
{
2-
"anonymous_token": "8aae43f148f990410b9a2af38324af24e87ab9227c9265627ddd10145db744295fcd8701dc45b1ab8985e142f491516295dd965bae848761274a577a62b0fdc54a50284d1e434dcc04ca6d1a52333c9a"
2+
"anonymous_token": "8aae43f148f990410b9a2af38324af24e87ab9227c9265627ddd10145db744295fcd8701dc45b1ab8985e142f491516295dd965bae848761274a577a62b0fdc54a50284d1e434dcc04ca6d1a52333c9a",
3+
"resourceTypeMap": {
4+
"0": "R_SO_4_",
5+
"1": "R_MV_5_",
6+
"2": "A_PL_0_",
7+
"3": "R_AL_3_",
8+
"4": "A_DJ_1_",
9+
"5": "R_VI_62_",
10+
"6": "A_EV_2_"
11+
}
312
}

0 commit comments

Comments
 (0)