forked from Binaryify/NeteaseCloudMusicApi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…yify#860, 支持手动传入realIP Binaryify#863
- Loading branch information
Showing
6 changed files
with
150 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
} | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
} | ||
) | ||
} | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters