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

合并相同接口;增加歌手视频接口;增加创建共享歌单的用法 #1402

Merged
merged 3 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@
223. 领取云豆
224. 获取 VIP 信息
225. 音乐人签到
226. 发送文本动态
227. 获取客户端歌曲下载 url
228. 获取歌单所有歌曲
229. 乐签信息
226. 获取客户端歌曲下载 url
227. 获取歌单所有歌曲
228. 乐签信息
229. 获取歌手视频

## 安装

Expand Down Expand Up @@ -982,7 +982,7 @@ tags: 歌单标签

**接口地址 :** `/share/resource`

**调用例子 :** `/share/resource?id=1297494209&msg=测试` `/share/resource?type=djradio&id=336355127` `/share/resource?type=djprogram&id=2061034798` `/share/resource?type=djprogram&id=2061034798&msg=测试@binaryify 测试`
**调用例子 :** `/share/resource?id=1297494209&msg=测试` `/share/resource?type=djradio&id=336355127` `/share/resource?type=djprogram&id=2061034798` `/share/resource?type=djprogram&id=2061034798&msg=测试@binaryify 测试` `/share/resource?type=noresource&msg=测试`

### 获取动态评论

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

`privacy` : 是否设置为隐私歌单,默认否,传'10'则设置成隐私歌单

`type` : 歌单类型,默认'NORMAL',传 'VIDEO'则为视频歌单
`type` : 歌单类型,默认'NORMAL',传 'VIDEO'则为视频歌单,传 'SHARED'则为共享歌单

**接口地址 :** `/playlist/create`

Expand Down Expand Up @@ -3588,14 +3588,6 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009`

**接口地址 :** `/playlist/privacy`

### 发送文本动态

说明: 可以调用此接口发送动态。

**必选参数 :** `msg` : 要发送的动态内容

**接口地址 :** `/send/event/text`

### 获取客户端歌曲下载 url

说明 : 使用 `/song/url` 接口获取的是歌曲试听 url, 但存在部分歌曲在非 VIP 账号上可以下载无损音质而不能试听无损音质, 使用此接口可使非 VIP 账号获取这些歌曲的无损音频
Expand All @@ -3606,6 +3598,22 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009`

**接口地址 :** `/song/download/url`

### 获取歌手视频

说明 : 调用此接口 , 传入歌手 id, 可获得歌手视频

**必选参数 :** `id` : 歌手 id

**可选参数 :** `size` : 返回数量 , 默认为 10

`cursor` : 返回数据的 cursor, 默认为 0 , 传入上一次返回结果的 cursor,将会返回下一页的数据

`order` : 排序方法, 0 表示按时间排序, 1 表示按热度排序, 默认为 0

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

**调用例子 :** `/artist/video?id=2116`

## 离线访问此文档

此文档同时也是 Progressive Web Apps(PWA), 加入了 serviceWorker, 可离线访问
Expand Down
11 changes: 7 additions & 4 deletions interface.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1542,16 +1542,19 @@ export function song_download_url(
} & RequestBaseConfig,
): Promise<Response>

export function send_event_text(
export function playlist_track_all(
params: {
msg: number | string
id: number | string
s?: number | string
} & RequestBaseConfig,
): Promise<Response>

export function playlist_track_all(
export function artist_video(
params: {
id: number | string
s?: number | string
size?: number | string
cursor?: number | string
order?: number | string
} & RequestBaseConfig,
): Promise<Response>

Expand Down
24 changes: 24 additions & 0 deletions module/artist_video.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// 歌手相关视频

module.exports = (query, request) => {
const data = {
artistId: query.id,
page: JSON.stringify({
size: query.size || 10,
cursor: query.cursor || 0,
}),
tab: 0,
order: query.order || 0,
}
return request(
'POST',
`https://music.163.com/weapi/mlog/artist/video`,
data,
{
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
},
)
}
2 changes: 1 addition & 1 deletion module/playlist_create.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = (query, request) => {
const data = {
name: query.name,
privacy: query.privacy, //0 为普通歌单,10 为隐私歌单
type: query.type || 'NORMAL', // NORMAL|VIDEO
type: query.type || 'NORMAL', // NORMAL|VIDEO|SHARED
}
return request('POST', `https://music.163.com/api/playlist/create`, data, {
crypto: 'weapi',
Expand Down
20 changes: 0 additions & 20 deletions module/send_event_text.js

This file was deleted.

2 changes: 1 addition & 1 deletion module/share_resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = (query, request) => {
const data = {
type: query.type || 'song', // song,playlist,mv,djprogramdjradio
type: query.type || 'song', // song,playlist,mv,djprogram,djradio,noresource
msg: query.msg || '',
id: query.id || '',
}
Expand Down