Merge pull request #1511 from chen310/master

feat: 新增黑胶时光机接口
This commit is contained in:
binaryify 2022-04-15 17:36:57 +08:00 committed by GitHub
commit 896560d554
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 0 deletions

View File

@ -257,6 +257,7 @@
239. 音乐人任务(新) 239. 音乐人任务(新)
240. 内部版本接口 240. 内部版本接口
241. 歌单更新播放量 241. 歌单更新播放量
242. 黑胶时光机
## 安装 ## 安装
@ -3834,6 +3835,18 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009`
**调用例子 :** `/inner/version` **调用例子 :** `/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年)
## 离线访问此文档 ## 离线访问此文档

8
interface.d.ts vendored
View File

@ -1615,3 +1615,11 @@ export function playlist_update_playcount(
id?: number | string id?: number | string
} & RequestBaseConfig, } & RequestBaseConfig,
): Promise<Response> ): Promise<Response>
export function vip_timemachine(
params: {
startTime?: number | string
endTime?: number | string
limit?: number | string
} & RequestBaseConfig,
): Promise<Response>

22
module/vip_timemachine.js Normal file
View File

@ -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,
},
)
}