mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-24 00:21:23 +08:00
refactor: api是否加密由配置文件决定;封装option
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// 通过传过来的歌单id拿到所有歌曲数据
|
||||
// 支持传递参数limit来限制获取歌曲的数据数量 例如: /playlist/track/all?id=7044354223&limit=10
|
||||
|
||||
const createOption = require('../util/option.js')
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
id: query.id,
|
||||
@@ -11,13 +12,12 @@ module.exports = (query, request) => {
|
||||
let limit = parseInt(query.limit) || Infinity
|
||||
let offset = parseInt(query.offset) || 0
|
||||
|
||||
return request('POST', `https://music.163.com/api/v6/playlist/detail`, data, {
|
||||
crypto: 'api',
|
||||
cookie: query.cookie,
|
||||
ua: query.ua || '',
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
}).then((res) => {
|
||||
return request(
|
||||
'POST',
|
||||
`/api/v6/playlist/detail`,
|
||||
data,
|
||||
createOption(query),
|
||||
).then((res) => {
|
||||
let trackIds = res.body.playlist.trackIds
|
||||
let idsData = {
|
||||
c:
|
||||
|
||||
Reference in New Issue
Block a user