resource_like.js 484 字节
Newer Older
N
Nzix 已提交
1
// 点赞与取消点赞资源
N
Nzix 已提交
2 3

module.exports = (query, request) => {
N
Nzix 已提交
4 5 6 7 8 9
    query.t = (query.t == 1 ? 'like' : 'unlike')
    query.type = {
        1: 'R_MV_5_', //  MV
        4: 'A_DJ_1_', //  电台
        5: 'R_VI_62_' //  视频
    }[query.type]
N
Nzix 已提交
10
    const data = {
N
Nzix 已提交
11
        threadId: query.type + query.id
N
Nzix 已提交
12 13 14 15 16 17
    }
    return request(
        'POST', `http://music.163.com/weapi/resource/${query.t}`, data,
        {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}
    )
}