mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-07 03:22:08 +08:00
check every module
This commit is contained in:
@ -1,48 +1,19 @@
|
||||
// module.exports = (req, res, createWebAPIRequest) => {
|
||||
// let cookie = req.get('Cookie') ? req.get('Cookie') : ''
|
||||
// cookie = 'os=pc;' + cookie
|
||||
// const rid = req.query.id
|
||||
// const typeMap = {
|
||||
// 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_' // 视频
|
||||
// }
|
||||
// const type = typeMap[req.query.type]
|
||||
// const data = {
|
||||
// offset: req.query.offset || 0,
|
||||
// rid: rid,
|
||||
// limit: req.query.limit || 20,
|
||||
// csrf_token: ''
|
||||
// }
|
||||
// const url = `/weapi/v1/resource/hotcomments/${type}${rid}`
|
||||
// createWebAPIRequest(
|
||||
// 'music.163.com',
|
||||
// url,
|
||||
// 'POST',
|
||||
// data,
|
||||
// cookie,
|
||||
// music_req => res.send(music_req),
|
||||
// err => res.status(502).send('fetch error')
|
||||
// )
|
||||
// }
|
||||
// 热门评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie = 'os=pc;' + query.cookie
|
||||
query.cookie = 'os=pc; ' + query.cookie
|
||||
query.type = {
|
||||
0: 'R_SO_4_', // 歌曲
|
||||
1: 'R_MV_5_', // mv
|
||||
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 = {
|
||||
offset: query.offset || 0,
|
||||
rid: query.id,
|
||||
limit: query.limit || 20
|
||||
limit: query.limit || 20,
|
||||
offset: query.offset || 0
|
||||
}
|
||||
return request(
|
||||
'POST', `http://music.163.com/weapi/v1/resource/hotcomments/${query.type}${query.id}`, data,
|
||||
|
Reference in New Issue
Block a user