Skip to content

Commit

Permalink
新增歌手分类列表,收藏/取消收藏歌手接口
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryify committed May 10, 2018
1 parent cff4fe1 commit 6ddc516
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 更新日志
### 2.9.7 | 2018.05.10
新增歌手分类列表,收藏/取消收藏歌手接口

### 2.9.6 | 2018.05.08
新增发送私信相关接口,新增新建歌单,收藏/取消收藏歌单接口

Expand Down
60 changes: 59 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
跨站请求伪造 (CSRF), 伪造请求头 , 调用官方 API

## 版本新特性
### 2.9.7 | 2018.05.10
新增歌手分类列表,收藏/取消收藏歌手接口

### 2.9.6 | 2018.05.08
新增发送私信相关接口,新增新建歌单,收藏/取消收藏歌单接口
Expand Down Expand Up @@ -392,6 +394,59 @@ Cookies

**调用例子 :** `/event`

### 歌手分类列表
说明 : 调用此接口,可获取歌手分类列表
**必选参数 :** `cat` : 即 category Code,歌手类型,默认 1001,返回华语男歌手数据
**可选参数 :**
`limit` : 返回数量 , 默认为 30

`offset` : 偏移数量,用于分页 , 如
: 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0
category Code 取值:
```
入驻歌手 5001
华语男歌手 1001
华语女歌手 1002
华语组合/乐队 1003
欧美男歌手 2001
欧美女歌手 2002
欧美组合/乐队 2003
日本男歌手 6001
日本女歌手 6002
日本组合/乐队 6003
韩国男歌手 7001
韩国女歌手 7002
韩国组合/乐队 7003
其他男歌手 4001
其他女歌手 4002
其他组合/乐队 4003
```

**接口地址 :** `/artist/list`


**调用例子 :** `/artist/list?cat=1001`

返回数据如下图:
![数据](https://ws1.sinaimg.cn/large/006tKfTcgy1fr60g9zps9j31kw1bpk4n.jpg)

### 收藏歌手
说明 : 调用此接口,可收藏歌手
**必选参数 :** `artistId` : 歌手 id

**接口地址 :** `/artist/sub`

**调用例子 :** `/artist/sub?id=6452`

### 取消收藏歌手
说明 : 调用此接口,可取消收藏歌手
**必选参数 :** `artistId` : 歌手 id

**接口地址 :** `/artist/unsub`


**调用例子 :** `/artist/unsub?id=6452`

### 歌单分类
说明 : 调用此接口,可获取歌单分类,包含 category 信息

Expand Down Expand Up @@ -510,7 +565,10 @@ mp3url 不能直接用 , 可通过 `/music/url` 接口传入歌曲 id 获取具

**必选参数 :** `keywords` : 关键词

**可选参数 :** `limit` : 返回数量 , 默认为 30 `offset` : 偏移数量,用于分页 , 如
**可选参数 :**
`limit` : 返回数量 , 默认为 30

`offset` : 偏移数量,用于分页 , 如
: 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0

`type`: 搜索类型;默认为 1 即单曲 , 取值意义 : 1: 单曲 10: 专辑 100: 歌手 1000:
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": "2.9.6",
"version": "2.9.7",
"description": "网易云音乐 NodeJS 版 API",
"scripts": {
"start": "node app.js",
Expand Down
2 changes: 1 addition & 1 deletion router/artist_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ router.get("/", (req, res) => {
categoryCode: req.query.cat || "1001",
offset: req.query.offset || 0,
total: req.query.total ? "true" : "false",
limit: req.query.limit || 50
limit: req.query.limit || 30
};
createWebAPIRequest(
"music.163.com",
Expand Down

0 comments on commit 6ddc516

Please sign in to comment.