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

Commit

Permalink
修复使用post请求取消喜欢音乐会失败的问题 #1024, 新增抱一抱评论和评论抱一抱列表接口 #1016, 新增收藏的专栏接口 #1026
Browse files Browse the repository at this point in the history
  • Loading branch information
Binaryify committed Nov 14, 2020
1 parent 99ec5bf commit 4018547
Show file tree
Hide file tree
Showing 14 changed files with 143 additions and 70 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# 更新日志
### 3.47.0 | 2020.11.14
- 修复使用post请求取消喜欢音乐会失败的问题 [#1024](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1024)

- 新增抱一抱评论和评论抱一抱列表接口 [#1016](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1016)

- 新增收藏的专栏接口[#1026](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1026)

### 3.46.1 | 2020.11.7
- 修复私信音乐接口出现风险提示的问题

Expand Down
3 changes: 3 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ banner({ type:0 }).then(res=>{
189. 账号信息
190. 最近联系人
191. 私信音乐
192. 抱一抱评论
193. 评论抱一抱列表
194. 收藏的专栏

## 更新日志

Expand Down
60 changes: 60 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@
189. 账号信息
190. 最近联系人
191. 私信音乐
192. 抱一抱评论
193. 评论抱一抱列表
194. 收藏的专栏

## 安装

Expand Down Expand Up @@ -1037,6 +1040,20 @@ tags: 歌单标签

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

### 收藏的专栏

说明 : 调用此接口,可获取收藏的专栏

**可选参数 :**

`limit`: 取出歌单数量 , 默认为 50

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

**接口地址 :** `/topic/sublist`

**调用例子 :** `/topic/sublist?limit=2&offset=1`

### 收藏视频

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

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

### 抱一抱评论

说明 : 调用此接口,可抱一抱评论

**必选参数 :**

`uid`: 用户id

`cid`: 评论id

`sid`: 资源id

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

**调用例子 :** `/hug/comment?uid=285516405&cid=1167145843&sid=863481066`

### 评论抱一抱列表

说明 : 调用此接口,可获取评论抱一抱列表

**必选参数 :**

`uid`: 用户id

`cid`: 评论id

`sid`: 资源id

**可选参数 :**

`page`: 页数

`cursor`: 上一页返回的cursor,默认-1,第一页不需要传

`idCursor`: 上一页返回的idCursor,默认-1,第一页不需要传

`pageSize` : 每页页数,默认100

**接口地址 :** `/comment/hug/list`

**调用例子 :** `/comment/hug/list?uid=285516405&cid=1167145843&sid=863481066&pageSize=2&page=1`


### 发送/删除评论

说明 : 调用此接口,可发送评论或者删除评论
Expand Down
26 changes: 26 additions & 0 deletions interface.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1307,3 +1307,29 @@ export function yunbei_task_finish(
depositCode?: number | string
} & RequestBaseConfig,
): Promise<Response>

export function msg_recentcontact(params: RequestBaseConfig): Promise<Response>

export function hug_comment(
params: {
uid: number | string
cid: number | string
sid: number | string
} & RequestBaseConfig,
): Promise<Response>

export function comment_hug_list(
params: {
page: number | string
cursor: number | string
idCursor: number | string
pageSize?: number | string
} & RequestBaseConfig,
): Promise<Response>

export function topic_sublist(
params: {
limit?: number | string
offset?: number | string
} & RequestBaseConfig,
): Promise<Response>
11 changes: 2 additions & 9 deletions module/comment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { resourceTypeMap } = require('../util/config.json')
// 发送与删除评论

module.exports = (query, request) => {
Expand All @@ -7,15 +8,7 @@ module.exports = (query, request) => {
0: 'delete',
2: 'reply',
}[query.t]
query.type = {
0: 'R_SO_4_', // 歌曲
1: 'R_MV_5_', // MV
2: 'A_PL_0_', // 歌单
3: 'R_AL_3_', // 专辑
4: 'A_DJ_1_', // 电台,
5: 'R_VI_62_', // 视频
6: 'A_EV_2_', // 动态
}[query.type]
query.type = resourceTypeMap[query.type]
const data = {
threadId: query.type + query.id,
}
Expand Down
10 changes: 2 additions & 8 deletions module/comment_floor.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
const { resourceTypeMap } = require('../util/config.json')
module.exports = (query, request) => {
query.type = {
0: 'R_SO_4_', // 歌曲
1: 'R_MV_5_', // MV
2: 'A_PL_0_', // 歌单
3: 'R_AL_3_', // 专辑
4: 'A_DJ_1_', // 电台,
5: 'R_VI_62_', // 视频
}[query.type]
query.type = resourceTypeMap[query.type]
const data = {
parentCommentId: query.parentCommentId,
threadId: query.type + query.id,
Expand Down
10 changes: 2 additions & 8 deletions module/comment_hot.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
const { resourceTypeMap } = require('../util/config.json')
// 热门评论

module.exports = (query, request) => {
query.cookie.os = 'pc'
query.type = {
0: 'R_SO_4_', // 歌曲
1: 'R_MV_5_', // MV
2: 'A_PL_0_', // 歌单
3: 'R_AL_3_', // 专辑
4: 'A_DJ_1_', // 电台,
5: 'R_VI_62_', // 视频
}[query.type]
query.type = resourceTypeMap[query.type]
const data = {
rid: query.id,
limit: query.limit || 20,
Expand Down
21 changes: 7 additions & 14 deletions module/comment_hug_list.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
const { resourceTypeMap } = require('../util/config.json')
module.exports = (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '7.3.27'
query.type = {
0: 'R_SO_4_', // 歌曲
1: 'R_MV_5_', // MV
2: 'A_PL_0_', // 歌单
3: 'R_AL_3_', // 专辑
4: 'A_DJ_1_', // 电台,
5: 'R_VI_62_', // 视频
6: 'A_EV_2_', // 动态
}[query.type]
const threadId = query.type + query.id
query.type = resourceTypeMap[query.type || 0]
const threadId = query.type + query.sid
const data = {
targetUserId: query.uid,
commentId: query.cid,
cursor: '-1',
cursor: query.cursor || '-1',
threadId: threadId,
pageNo: 1,
idCursor: -1,
pageSize: 100,
pageNo: query.page || 1,
idCursor: query.idCursor || -1,
pageSize: query.pageSize || 100,
}
return request(
'POST',
Expand Down
11 changes: 2 additions & 9 deletions module/comment_like.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
const { resourceTypeMap } = require('../util/config.json')
// 点赞与取消点赞评论

module.exports = (query, request) => {
query.cookie.os = 'pc'
query.t = query.t == 1 ? 'like' : 'unlike'
query.type = {
0: 'R_SO_4_', // 歌曲
1: 'R_MV_5_', // MV
2: 'A_PL_0_', // 歌单
3: 'R_AL_3_', // 专辑
4: 'A_DJ_1_', // 电台,
5: 'R_VI_62_', // 视频
6: 'A_EV_2_', // 动态
}[query.type]
query.type = resourceTypeMap[query.type]
const data = {
threadId: query.type + query.id,
commentId: query.cid,
Expand Down
13 changes: 3 additions & 10 deletions module/comment_new.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
const { resourceTypeMap } = require('../util/config.json')
// 评论

module.exports = (query, request) => {
query.cookie.os = 'pc'
query.type = {
0: 'R_SO_4_', // 歌曲
1: 'R_MV_5_', // MV
2: 'A_PL_0_', // 歌单
3: 'R_AL_3_', // 专辑
4: 'A_DJ_1_', // 电台,
5: 'R_VI_62_', // 视频
6: 'A_EV_2_', // 动态
}[query.type]
query.type = resourceTypeMap[query.type]
const threadId = query.type + query.id
const pageSize = query.pageSize || 20
const pageNo = query.pageNo || 1
const data = {
threadId: threadId, //'R_SO_4_863481066',
threadId: threadId,
pageNo,
showInner: query.showInner || true,
pageSize,
Expand Down
13 changes: 3 additions & 10 deletions module/hug_comment.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
const { resourceTypeMap } = require('../util/config.json')
module.exports = (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '7.3.27'
query.type = {
0: 'R_SO_4_', // 歌曲
1: 'R_MV_5_', // MV
2: 'A_PL_0_', // 歌单
3: 'R_AL_3_', // 专辑
4: 'A_DJ_1_', // 电台,
5: 'R_VI_62_', // 视频
6: 'A_EV_2_', // 动态
}[query.type]
const threadId = query.type + query.id
query.type = resourceTypeMap[query.type || 0]
const threadId = query.type + query.sid
const data = {
targetUserId: query.uid,
commentId: query.cid,
Expand Down
15 changes: 15 additions & 0 deletions module/topic_sub_list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 收藏的专栏

module.exports = (query, request) => {
const data = {
limit: query.limit || 50,
offset: query.offset || 0,
total: true,
}
return request('POST', `https://music.163.com/api/topic/sublist`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
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.46.1",
"version": "3.47.0",
"description": "网易云音乐 NodeJS 版 API",
"scripts": {
"start": "node app.js",
Expand Down
11 changes: 10 additions & 1 deletion util/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"anonymous_token": "8aae43f148f990410b9a2af38324af24e87ab9227c9265627ddd10145db744295fcd8701dc45b1ab8985e142f491516295dd965bae848761274a577a62b0fdc54a50284d1e434dcc04ca6d1a52333c9a"
"anonymous_token": "8aae43f148f990410b9a2af38324af24e87ab9227c9265627ddd10145db744295fcd8701dc45b1ab8985e142f491516295dd965bae848761274a577a62b0fdc54a50284d1e434dcc04ca6d1a52333c9a",
"resourceTypeMap": {
"0": "R_SO_4_",
"1": "R_MV_5_",
"2": "A_PL_0_",
"3": "R_AL_3_",
"4": "A_DJ_1_",
"5": "R_VI_62_",
"6": "A_EV_2_"
}
}

1 comment on commit 4018547

@vercel
Copy link

@vercel vercel bot commented on 4018547 Nov 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.