mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-20 14:41:23 +08:00
feat: 增加下载、购买记录接口
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const { cookieToJson } = require('../util/index')
|
||||
const createOption = require('../util/option.js')
|
||||
module.exports = (query, request) => {
|
||||
const method = query.method || 'POST'
|
||||
@@ -6,6 +7,10 @@ module.exports = (query, request) => {
|
||||
try {
|
||||
data =
|
||||
typeof query.data === 'string' ? JSON.parse(query.data) : query.data || {}
|
||||
if (typeof data.cookie === 'string') {
|
||||
data.cookie = cookieToJson(data.cookie)
|
||||
query.cookie = data.cookie
|
||||
}
|
||||
} catch (e) {
|
||||
data = {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
// 会员下载歌曲记录
|
||||
|
||||
const createOption = require('../util/option.js')
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
limit: query.limit || '20',
|
||||
offset: query.offset || '0',
|
||||
total: 'true',
|
||||
}
|
||||
return request('POST', `/api/member/song/downlist`, data, createOption(query))
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// 会员本月下载歌曲记录
|
||||
|
||||
const createOption = require('../util/option.js')
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
limit: query.limit || '20',
|
||||
offset: query.offset || '0',
|
||||
total: 'true',
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`/api/member/song/monthdownlist`,
|
||||
data,
|
||||
createOption(query),
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// 已购买单曲
|
||||
|
||||
const createOption = require('../util/option.js')
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
limit: query.limit || '20',
|
||||
offset: query.offset || '0',
|
||||
total: 'true',
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`/api/member/song/singledownlist`,
|
||||
data,
|
||||
createOption(query),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user