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

Commit 50a1cb3

Browse files
committed
新增精品歌单标签列表接口 #921, 新增用户等级信息接口 #929,增加新接口的 d.ts 文件,修复登录接口的 d.ts 的 countrycode 为非可选属性的错误
1 parent cb4c07f commit 50a1cb3

13 files changed

+77
-6
lines changed

CHANGELOG.MD

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# 更新日志
2+
### 3.41.0 | 2020.09.19
3+
- 新增`精品歌单标签列表`接口 [#921](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/921)
4+
5+
- 新增`用户等级信息`接口 [#929](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/929)
6+
7+
- 增加新接口的 d.ts 文件,修复登录接口的 d.ts 的 countrycode 为非可选属性的错误
8+
29
### 3.40.1 | 2020.09.13
310
- 更新 TypeScript 声明 [#928](https://github.com/Binaryify/NeteaseCloudMusicApi/pull/928)
411

README.MD

+4
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ banner({ type:0 }).then(res=>{
265265
163. 数字专辑详情
266266
164. 更新头像
267267
165. 歌单封面上传
268+
166. 歌曲楼层评论
269+
167. 歌手全部歌曲
270+
168. 精品歌单标签列表
271+
169. 用户等级信息
268272

269273

270274
## 更新日志

docs/README.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@
183183
165. 歌单封面上传
184184
166. 歌曲楼层评论
185185
167. 歌手全部歌曲
186+
168. 精品歌单标签列表
187+
169. 用户等级信息
186188

187189
## 安装
188190

@@ -516,6 +518,14 @@ v3.30.0后支持手动传入cookie,登录接口返回内容新增 `cookie` 字
516518

517519
**调用例子 :** `/user/subcount`
518520

521+
### 获取用户等级信息
522+
523+
说明 : 登陆后调用此接口 , 可以获取用户等级信息,包含当前登陆天数,听歌次数,下一等级需要的登录天数和听歌次数,当前等级进度,对应 https://music.163.com/#/user/level
524+
525+
**接口地址 :** `/user/level`
526+
527+
**调用例子 :** `/user/level`
528+
519529
### 更新用户信息
520530

521531
说明 : 登陆后调用此接口 , 传入相关信息,可以更新用户信息
@@ -1032,20 +1042,27 @@ tags: 歌单标签
10321042

10331043
**调用例子 :** `/top/playlist?limit=10&order=new`
10341044

1045+
### 精品歌单标签列表
1046+
说明 : 调用此接口 , 可获取精品歌单标签列表
1047+
1048+
**接口地址 :** `/playlist/highquality/tags`
1049+
1050+
**调用例子 :** `/playlist/highquality/tags`
1051+
10351052
### 获取精品歌单
10361053

10371054
说明 : 调用此接口 , 可获取精品歌单
10381055

10391056
**可选参数 :** `cat`: tag, 比如 " 华语 "、" 古风 " 、" 欧美 "、" 流行 ", 默认为
1040-
"全部",可从歌单分类接口获取(/playlist/catlist)
1057+
"全部",可从精品歌单标签列表接口获取(`/playlist/highquality/tags`)
10411058

10421059
`limit`: 取出歌单数量 , 默认为 20
10431060

10441061
`before`: 分页参数,取上一页最后一个歌单的 `updateTime` 获取下一页数据
10451062

10461063
**接口地址 :** `/top/playlist/highquality`
10471064

1048-
**调用例子 :** `http://localhost:3000/top/playlist/highquality?before=1503639064232&limit=3`
1065+
**调用例子 :** `/top/playlist/highquality?before=1503639064232&limit=3`
10491066

10501067
### 相关歌单推荐
10511068

interface.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,5 @@ export * from './module_types/video_timeline_recommend'
178178
export * from './module_types/video_url'
179179
export * from './module_types/weblog'
180180
export * from './module_types/base'
181+
export * from './module_types/user_level'
182+
export * from './module_types/playlist_highquality_tags'

main.d.ts

+8
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ import {
180180
VideoUrlRequestConfig,
181181
WeblogRequestConfig,
182182
APIBaseResponse,
183+
UserLevelRequestConfig,
184+
PlaylistHighqualityTagsRequestConfig
183185
} from './interface'
184186
// Start
185187
// export interface Response<T> {
@@ -484,6 +486,9 @@ interface APIInstance {
484486
playlist_detail: (
485487
params: PlaylistDetailRequestConfig,
486488
) => Promise<Response<APIBaseResponse>>
489+
playlist_highquality_tags: (
490+
params: PlaylistHighqualityTagsRequestConfig,
491+
) => Promise<Response<APIBaseResponse>>
487492
playlist_hot: (
488493
params: PlaylistHotRequestConfig,
489494
) => Promise<Response<APIBaseResponse>>
@@ -620,6 +625,9 @@ interface APIInstance {
620625
params: UserDetailRequestConfig,
621626
) => Promise<Response<APIBaseResponse>>
622627
user_dj: (params: UserDjRequestConfig) => Promise<Response<APIBaseResponse>>
628+
user_level: (
629+
params: UserLevelRequestConfig,
630+
) => Promise<Response<APIBaseResponse>>
623631
user_event: (
624632
params: UserEventRequestConfig,
625633
) => Promise<Response<APIBaseResponse>>

module/login_cellphone.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = async (query, request) => {
66
query.cookie.os = 'pc'
77
const data = {
88
phone: query.phone,
9-
countrycode: query.countrycode,
9+
countrycode: query.countrycode || '86',
1010
password:
1111
query.md5_password ||
1212
crypto.createHash('md5').update(query.password).digest('hex'),

module/playlist_highquality_tags.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// 精品歌单 tags
2+
module.exports = (query, request) => {
3+
const data = {}
4+
return request(
5+
'POST',
6+
`https://music.163.com/api/playlist/highquality/tags`,
7+
data,
8+
{
9+
crypto: 'weapi',
10+
cookie: query.cookie,
11+
proxy: query.proxy,
12+
realIP: query.realIP,
13+
},
14+
)
15+
}

module/top_playlist_highquality.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = (query, request) => {
99
}
1010
return request(
1111
'POST',
12-
`https://music.163.com/weapi/playlist/highquality/list`,
12+
`https://music.163.com/api/playlist/highquality/list`,
1313
data,
1414
{
1515
crypto: 'weapi',

module/user_level.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// 类别热门电台
2+
3+
module.exports = (query, request) => {
4+
const data = {}
5+
return request('POST', `https://music.163.com/weapi/user/level`, data, {
6+
crypto: 'weapi',
7+
cookie: query.cookie,
8+
proxy: query.proxy,
9+
realIP: query.realIP,
10+
})
11+
}

module_types/login_cellphone.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { RequestBaseConfig } from './base'
22

33
export interface LoginCellphoneRequestConfig extends RequestBaseConfig {
44
phone: string
5-
countrycode: string
5+
countrycode?: string
66
password?: string
77
md5_password?: string
88
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { RequestBaseConfig } from './base'
2+
3+
export interface PlaylistHighqualityTagsRequestConfig extends RequestBaseConfig {
4+
}

module_types/user_level.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { RequestBaseConfig } from './base'
2+
3+
export type UserLevelRequestConfig = RequestBaseConfig

package.json

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

0 commit comments

Comments
 (0)