v3.26.0, 更新歌手分类列表接口参数

This commit is contained in:
binaryify 2020-04-08 18:33:01 +08:00
parent ec3fac99e0
commit a77736cb63
4 changed files with 37 additions and 55 deletions

View File

@ -1,4 +1,8 @@
# 更新日志 # 更新日志
### 3.26.0 | 2020.04.08
#### Breaking change
- 更新歌手分类列表接口参数,因`cat`参数失效,调整为`type`和`area`参数
### 3.25.4 | 2020.03.18 ### 3.25.4 | 2020.03.18
- 更新歌词,歌手分类列表接口 - 更新歌词,歌手分类列表接口

View File

@ -733,47 +733,30 @@ tags: 歌单标签
`offset` : 偏移数量,用于分页 , 如 `offset` : 偏移数量,用于分页 , 如
: 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0 : 如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0
`initial`: 按首字母索引查找参数,如 `/artist/list?cat=1001&initial=b` 返回内容将以 name 字段开头为 b 或者拼音开头为 b 为顺序排列 `initial`: 按首字母索引查找参数,如 `/artist/list?type=1&area=96&initial=b` 返回内容将以 name 字段开头为 b 或者拼音开头为 b 为顺序排列
category Code 取值: `type` 取值:
``` ```
入驻歌手 5001 1:男歌手
2:女歌手
华语男歌手 1001 3:乐队
华语女歌手 1002
华语组合/乐队 1003
欧美男歌手 2001
欧美女歌手 2002
欧美组合/乐队 2003
日本男歌手 6001
日本女歌手 6002
日本组合/乐队 6003
韩国男歌手 7001
韩国女歌手 7002
韩国组合/乐队 7003
其他男歌手 4001
其他女歌手 4002
其他组合/乐队 4003
``` ```
`area` 取值:
```
-1:全部
7华语
96欧美
8:日本
16韩国
0:其他
```
**接口地址 :** `/artist/list` **接口地址 :** `/artist/list`
**调用例子 :** `/artist/list?cat=1001` **调用例子 :** `/artist/list?type=1&area=96&initial=b` `/artist/list?type=2&area=2&initial=b`
返回数据如下图: 返回数据如下图:
![数据](https://ws1.sinaimg.cn/large/006tKfTcgy1fr60g9zps9j31kw1bpk4n.jpg) ![数据](https://ws1.sinaimg.cn/large/006tKfTcgy1fr60g9zps9j31kw1bpk4n.jpg)

View File

@ -1,35 +1,30 @@
// 歌手分类 // 歌手分类
/* /*
categoryCode 取值 type 取值
入驻歌手 5001 1:男歌手
华语男歌手 1001 2:女歌手
华语女歌手 1002 3:乐队
华语组合/乐队 1003
欧美男歌手 2001 area 取值
欧美女歌手 2002 -1:全部
欧美组合/乐队 2003 7华语
日本男歌手 6001 96欧美
日本女歌手 6002 8:日本
日本组合/乐队 6003 16韩国
韩国男歌手 7001 0:其他
韩国女歌手 7002
韩国组合/乐队 7003
其他男歌手 4001
其他女歌手 4002
其他组合/乐队 4003
initial 取值 a-z/A-Z initial 取值 a-z/A-Z
*/ */
module.exports = (query, request) => { module.exports = (query, request) => {
const data = { const data = {
categoryCode: query.cat || '1001',
// initial: (query.initial || '').toUpperCase().charCodeAt() || '',
initial: isNaN(query.initial) ? (query.initial || '').toUpperCase().charCodeAt() || undefined : query.initial, initial: isNaN(query.initial) ? (query.initial || '').toUpperCase().charCodeAt() || undefined : query.initial,
offset: query.offset || 0, offset: query.offset || 0,
limit: query.limit || 30, limit: query.limit || 30,
total: true total: true,
type: query.type || '1',
area: query.area
} }
return request( return request(
'POST', `https://music.163.com/api/v1/artist/list`, data, 'POST', `https://music.163.com/api/v1/artist/list`, data,

View File

@ -1,6 +1,6 @@
{ {
"name": "NeteaseCloudMusicApi", "name": "NeteaseCloudMusicApi",
"version": "3.25.4", "version": "3.26.0",
"description": "网易云音乐 NodeJS 版 API", "description": "网易云音乐 NodeJS 版 API",
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",