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

feat: 新增黑胶时光机接口 #1511

Merged
merged 1 commit into from
Apr 15, 2022
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
13 changes: 13 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@
239. 音乐人任务(新)
240. 内部版本接口
241. 歌单更新播放量
242. 黑胶时光机

## 安装

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

**调用例子 :** `/inner/version`

### 黑胶时光机

说明 : 调用此接口 , 可获得黑胶时光机数据

**可选参数 :** `startTime` : 开始时间
`endTime` : 结束时间
`limit` : 返回数量 , 默认为 60

**接口地址 :** `/vip/timemachine`

**调用例子 :** `/vip/timemachine` `/vip/timemachine?startTime=1638288000000&endTime=1640966399999&limit=10`(2021年12月) `/vip/timemachine?startTime=1609430400&endTime=1640966399999&limit=60`(2021年)


## 离线访问此文档

Expand Down
8 changes: 8 additions & 0 deletions interface.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1615,3 +1615,11 @@ export function playlist_update_playcount(
id?: number | string
} & RequestBaseConfig,
): Promise<Response>

export function vip_timemachine(
params: {
startTime?: number | string
endTime?: number | string
limit?: number | string
} & RequestBaseConfig,
): Promise<Response>
22 changes: 22 additions & 0 deletions module/vip_timemachine.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// 黑胶时光机

module.exports = (query, request) => {
const data = {}
if (query.startTime && query.endTime) {
data.startTime = query.startTime
data.endTime = query.endTime
data.type = 1
data.limit = query.limit || 60
}
return request(
'POST',
`https://music.163.com/weapi/vipmusic/newrecord/weekflow`,
data,
{
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
},
)
}