Merge pull request #200 from floatwoozy/feat/listen-data-song-play-rank

feat: 新增 listen_data_song_play_rank 歌曲播放排行接口
This commit is contained in:
ElyPrism 2026-06-29 16:14:11 +08:00 committed by GitHub
commit 6eb31984fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 36 additions and 0 deletions

7
interface.d.ts vendored
View File

@ -2049,6 +2049,13 @@ export function listen_data_report(
} & RequestBaseConfig,
): Promise<Response>
export function listen_data_song_play_rank(
params: {
type?: string
endTime?: string | number
} & RequestBaseConfig,
): Promise<Response>
export function listen_data_today_song(
params: RequestBaseConfig,
): Promise<Response>

View File

@ -0,0 +1,12 @@
// 听歌足迹 - 歌曲播放排行 (Top20)
const createOption = require('../util/option.js')
module.exports = (query, request) => {
return request(
`/api/content/activity/listen/data/song/play/rank`,
{
type: query.type || 'month', //周 week 月 month
endTime: query.endTime, // 不填就是本周/月的
},
createOption(query),
)
}

View File

@ -4810,6 +4810,23 @@ bitrate = Math.floor(br / 1000)
**接口地址 :** `/listen/data/today/song`
### 听歌足迹 - 歌曲播放排行
说明 : 登录后调用此接口, 获取歌曲播放排行, 返回每首歌的播放次数 (playCount); 默认返回前 20 名 (Top20), 不足则返回全部
**必选参数 :**
`type`: 维度类型 周 week 月 month
**可选参数 :**
`endTime` : 周: 每周周六 0 点的时间戳 月: 每月最后一天 0 点的时间戳
不填就是本周/月的
**接口地址 :** `/listen/data/song/play/rank`
**调用例子 :** `/listen/data/song/play/rank?type=month`
### 听歌足迹 - 总收听时长
说明 : 登录后调用此接口, 获取总收听时长; 相关接口可能需要 vip 权限