mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 05:38:04 +00:00
refactor: rename napi to netease_api
This commit is contained in:
parent
e030647720
commit
fe8b3261ca
228 changed files with 1 additions and 1 deletions
29
netease_api/module/resource_like.js
Normal file
29
netease_api/module/resource_like.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// 点赞与取消点赞资源
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc';
|
||||
query.t = query.t == 1 ? 'like' : 'unlike';
|
||||
query.type = {
|
||||
1: 'R_MV_5_', // MV
|
||||
4: 'A_DJ_1_', // 电台
|
||||
5: 'R_VI_62_', // 视频
|
||||
6: 'A_EV_2_',
|
||||
}[query.type];
|
||||
const data = {
|
||||
threadId: query.type + query.id,
|
||||
};
|
||||
if (query.type === 'A_EV_2_') {
|
||||
data.threadId = query.threadId;
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/weapi/resource/${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