mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-20 22:51:23 +08:00
@@ -0,0 +1,17 @@
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
const data = {
|
||||
id: query.id,
|
||||
private_cloud: 'true',
|
||||
work_type: 1,
|
||||
order: query.order || 'hot', //hot,time
|
||||
offset: query.offset || 0,
|
||||
limit: query.limit || 100,
|
||||
}
|
||||
return request('POST', `https://music.163.com/api/v1/artist/songs`, data, {
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
module.exports = (query, request) => {
|
||||
query.type = {
|
||||
0: 'R_SO_4_', // 歌曲
|
||||
1: 'R_MV_5_', // MV
|
||||
2: 'A_PL_0_', // 歌单
|
||||
3: 'R_AL_3_', // 专辑
|
||||
4: 'A_DJ_1_', // 电台,
|
||||
5: 'R_VI_62_', // 视频
|
||||
}[query.type]
|
||||
const data = {
|
||||
parentCommentId: query.parentCommentId,
|
||||
threadId: query.type + query.id,
|
||||
time: query.time || -1,
|
||||
limit: query.limit || 20,
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/api/resource/comment/floor/get`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
}
|
||||
)
|
||||
}
|
||||
+43
-12
@@ -1,20 +1,51 @@
|
||||
// 收藏单曲到歌单 从歌单删除歌曲
|
||||
|
||||
module.exports = (query, request) => {
|
||||
module.exports = async (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
const tracks = query.tracks.split(',')
|
||||
const data = {
|
||||
op: query.op, // del,add
|
||||
pid: query.pid, // 歌单id
|
||||
trackIds: '[' + query.tracks + ']', // 歌曲id
|
||||
trackIds: JSON.stringify(tracks), // 歌曲id
|
||||
imme: 'true',
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/weapi/playlist/manipulate/tracks`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
|
||||
try {
|
||||
const res = await request(
|
||||
'POST',
|
||||
`http://music.163.com/api/playlist/manipulate/tracks`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
}
|
||||
)
|
||||
return {
|
||||
status: 200,
|
||||
body: {
|
||||
...res,
|
||||
},
|
||||
}
|
||||
)
|
||||
} catch (error) {
|
||||
if (error.body.code === 512) {
|
||||
return request(
|
||||
'POST',
|
||||
`http://music.163.com/api/playlist/manipulate/tracks`,
|
||||
{
|
||||
op: query.op, // del,add
|
||||
pid: query.pid, // 歌单id
|
||||
trackIds: JSON.stringify([...tracks, ...tracks]),
|
||||
imme: 'true',
|
||||
},
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user