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

Commit

Permalink
新增精品歌单标签列表接口 #921, 新增用户等级信息接口 #929,增加新接口的 d.ts 文件,修复登录接口的 d.ts 的 coun…
Browse files Browse the repository at this point in the history
…trycode 为非可选属性的错误
  • Loading branch information
Binaryify committed Sep 19, 2020
1 parent cb4c07f commit 50a1cb3
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# 更新日志
### 3.41.0 | 2020.09.19
- 新增`精品歌单标签列表`接口 [#921](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/921)

- 新增`用户等级信息`接口 [#929](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/929)

- 增加新接口的 d.ts 文件,修复登录接口的 d.ts 的 countrycode 为非可选属性的错误

### 3.40.1 | 2020.09.13
- 更新 TypeScript 声明 [#928](https://github.com/Binaryify/NeteaseCloudMusicApi/pull/928)

Expand Down
4 changes: 4 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ banner({ type:0 }).then(res=>{
163. 数字专辑详情
164. 更新头像
165. 歌单封面上传
166. 歌曲楼层评论
167. 歌手全部歌曲
168. 精品歌单标签列表
169. 用户等级信息


## 更新日志
Expand Down
21 changes: 19 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@
165. 歌单封面上传
166. 歌曲楼层评论
167. 歌手全部歌曲
168. 精品歌单标签列表
169. 用户等级信息

## 安装

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

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

### 获取用户等级信息

说明 : 登陆后调用此接口 , 可以获取用户等级信息,包含当前登陆天数,听歌次数,下一等级需要的登录天数和听歌次数,当前等级进度,对应 https://music.163.com/#/user/level

**接口地址 :** `/user/level`

**调用例子 :** `/user/level`

### 更新用户信息

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

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

### 精品歌单标签列表
说明 : 调用此接口 , 可获取精品歌单标签列表

**接口地址 :** `/playlist/highquality/tags`

**调用例子 :** `/playlist/highquality/tags`

### 获取精品歌单

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

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

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

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

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

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

### 相关歌单推荐

Expand Down
2 changes: 2 additions & 0 deletions interface.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,5 @@ export * from './module_types/video_timeline_recommend'
export * from './module_types/video_url'
export * from './module_types/weblog'
export * from './module_types/base'
export * from './module_types/user_level'
export * from './module_types/playlist_highquality_tags'
8 changes: 8 additions & 0 deletions main.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ import {
VideoUrlRequestConfig,
WeblogRequestConfig,
APIBaseResponse,
UserLevelRequestConfig,
PlaylistHighqualityTagsRequestConfig
} from './interface'
// Start
// export interface Response<T> {
Expand Down Expand Up @@ -484,6 +486,9 @@ interface APIInstance {
playlist_detail: (
params: PlaylistDetailRequestConfig,
) => Promise<Response<APIBaseResponse>>
playlist_highquality_tags: (
params: PlaylistHighqualityTagsRequestConfig,
) => Promise<Response<APIBaseResponse>>
playlist_hot: (
params: PlaylistHotRequestConfig,
) => Promise<Response<APIBaseResponse>>
Expand Down Expand Up @@ -620,6 +625,9 @@ interface APIInstance {
params: UserDetailRequestConfig,
) => Promise<Response<APIBaseResponse>>
user_dj: (params: UserDjRequestConfig) => Promise<Response<APIBaseResponse>>
user_level: (
params: UserLevelRequestConfig,
) => Promise<Response<APIBaseResponse>>
user_event: (
params: UserEventRequestConfig,
) => Promise<Response<APIBaseResponse>>
Expand Down
2 changes: 1 addition & 1 deletion module/login_cellphone.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = async (query, request) => {
query.cookie.os = 'pc'
const data = {
phone: query.phone,
countrycode: query.countrycode,
countrycode: query.countrycode || '86',
password:
query.md5_password ||
crypto.createHash('md5').update(query.password).digest('hex'),
Expand Down
15 changes: 15 additions & 0 deletions module/playlist_highquality_tags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 精品歌单 tags
module.exports = (query, request) => {
const data = {}
return request(
'POST',
`https://music.163.com/api/playlist/highquality/tags`,
data,
{
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
},
)
}
2 changes: 1 addition & 1 deletion module/top_playlist_highquality.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = (query, request) => {
}
return request(
'POST',
`https://music.163.com/weapi/playlist/highquality/list`,
`https://music.163.com/api/playlist/highquality/list`,
data,
{
crypto: 'weapi',
Expand Down
11 changes: 11 additions & 0 deletions module/user_level.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// 类别热门电台

module.exports = (query, request) => {
const data = {}
return request('POST', `https://music.163.com/weapi/user/level`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
2 changes: 1 addition & 1 deletion module_types/login_cellphone.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { RequestBaseConfig } from './base'

export interface LoginCellphoneRequestConfig extends RequestBaseConfig {
phone: string
countrycode: string
countrycode?: string
password?: string
md5_password?: string
}
4 changes: 4 additions & 0 deletions module_types/playlist_highquality_tags.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { RequestBaseConfig } from './base'

export interface PlaylistHighqualityTagsRequestConfig extends RequestBaseConfig {
}
3 changes: 3 additions & 0 deletions module_types/user_level.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { RequestBaseConfig } from './base'

export type UserLevelRequestConfig = RequestBaseConfig
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.40.1",
"version": "3.41.0",
"description": "网易云音乐 NodeJS 版 API",
"scripts": {
"start": "node app.js",
Expand Down

1 comment on commit 50a1cb3

@vercel
Copy link

@vercel vercel bot commented on 50a1cb3 Sep 19, 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.