mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-22 15:41:23 +08:00
Merge branch 'bandage' of https://github.com/nondanee/NeteaseCloudMusicApi into bandage
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
module.exports = (req, res, createWebAPIRequest, request) => {
|
||||
const cookie = req.get('Cookie') ? req.get('Cookie') : ''
|
||||
const id = req.query.id
|
||||
const action = req.query.action == 1 ? 'add' : 'delete'
|
||||
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]
|
||||
|
||||
let data = {
|
||||
threadId: `${type}${id}`,
|
||||
csrf_token: ''
|
||||
}
|
||||
|
||||
if (action == 'add') {
|
||||
data = {
|
||||
...data,
|
||||
content: req.query.content
|
||||
}
|
||||
}
|
||||
|
||||
if (action == 'delete') {
|
||||
data = {
|
||||
...data,
|
||||
commentId: req.query.commentId
|
||||
}
|
||||
}
|
||||
|
||||
const url = `/weapi/resource/comments/${action}`
|
||||
|
||||
// console.log({ url, data })
|
||||
createWebAPIRequest(
|
||||
'music.163.com',
|
||||
url,
|
||||
'POST',
|
||||
data,
|
||||
cookie,
|
||||
music_req => res.send(music_req),
|
||||
err => res.status(502).send('fetch error')
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
module.exports = (req, res, createWebAPIRequest) => {
|
||||
let cookie = req.get('Cookie') ? req.get('Cookie') : ''
|
||||
cookie += ';os=pc;'
|
||||
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')
|
||||
)
|
||||
}
|
||||
+20
-20
@@ -1,32 +1,32 @@
|
||||
//comment like
|
||||
//未知 api
|
||||
module.exports = (req, res, createWebAPIRequest, request) => {
|
||||
const cookie = req.get("Cookie") ? req.get("Cookie") : "";
|
||||
const cid = req.query.cid; //评论 id
|
||||
const id = req.query.id; // 歌曲 id
|
||||
const cookie = req.get('Cookie') ? req.get('Cookie') : ''
|
||||
const cid = req.query.cid //评论 id
|
||||
const id = 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_" //电台
|
||||
};
|
||||
const type = typeMap[req.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_' // 视频
|
||||
}
|
||||
const type = typeMap[req.query.type]
|
||||
const data = {
|
||||
threadId: `${type}${id}`,
|
||||
commentId: cid,
|
||||
csrf_token: ""
|
||||
};
|
||||
const action = req.query.t == 1 ? "like" : "unlike";
|
||||
csrf_token: ''
|
||||
}
|
||||
const action = req.query.t == 1 ? 'like' : 'unlike'
|
||||
|
||||
const url = `/weapi/v1/comment/${action}`;
|
||||
const url = `/weapi/v1/comment/${action}`
|
||||
createWebAPIRequest(
|
||||
"music.163.com",
|
||||
'music.163.com',
|
||||
url,
|
||||
"POST",
|
||||
'POST',
|
||||
data,
|
||||
cookie,
|
||||
music_req => res.send(music_req),
|
||||
err => res.status(502).send("fetch error")
|
||||
);
|
||||
};
|
||||
err => res.status(502).send('fetch error')
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
module.exports = (req, res, createWebAPIRequest, request) => {
|
||||
const rid = req.query.id
|
||||
const cookie = req.get('Cookie') ? req.get('Cookie') : ''
|
||||
const data = {
|
||||
offset: req.query.offset || 0,
|
||||
rid: rid,
|
||||
limit: req.query.limit || 20,
|
||||
csrf_token: ''
|
||||
}
|
||||
createWebAPIRequest(
|
||||
'music.163.com',
|
||||
`/weapi/v1/resource/comments/R_VI_62_${rid}/?csrf_token=`,
|
||||
'POST',
|
||||
data,
|
||||
cookie,
|
||||
music_req => {
|
||||
res.send(music_req)
|
||||
},
|
||||
err => res.status(502).send('fetch error')
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user