mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 21:58:03 +00:00
feat: integrate api in electron app
This commit is contained in:
parent
bd29570e31
commit
74bf714c28
240 changed files with 21003 additions and 112 deletions
33
napi/module/comment_like.js
Normal file
33
napi/module/comment_like.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// 点赞与取消点赞评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc';
|
||||
query.t = query.t == 1 ? 'like' : 'unlike';
|
||||
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_', // 视频
|
||||
6: 'A_EV_2_', // 动态
|
||||
}[query.type];
|
||||
const data = {
|
||||
threadId: query.type + query.id,
|
||||
commentId: query.cid,
|
||||
};
|
||||
if (query.type == 'A_EV_2_') {
|
||||
data.threadId = query.threadId;
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/weapi/v1/comment/${query.t}`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue