refactor:合并年度听歌报告接口

This commit is contained in:
overwriter
2023-09-23 13:38:45 +08:00
parent 5506e31c43
commit bb7f0734f5
8 changed files with 27 additions and 146 deletions

19
module/summary_annual.js Normal file
View File

@@ -0,0 +1,19 @@
// 年度听歌报告2017-2022
const crypto = require('crypto')
module.exports = (query, request) => {
const data = {}
const key =
['2017', '2018', '2019'].indexOf(query.year) > -1 ? 'userdata' : 'data'
return request(
'POST',
`https://music.163.com/weapi/activity/summary/annual/${query.year}/${key}`,
data,
{
crypto: 'eapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
url: `/api/activity/summary/annual/${query.year}/${key}`,
},
)
}