comment_like.js 643 字节
Newer Older
N
Nzix 已提交
1
// 点赞与取消点赞评论
N
Nzix 已提交
2 3

module.exports = (query, request) => {
N
Nzix 已提交
4
    query.cookie.os = 'pc'
N
Nzix 已提交
5 6 7
    query.t = (query.t == 1 ? 'like' : 'unlike')
    query.type = {
        0: 'R_SO_4_', //  歌曲
N
Nzix 已提交
8
        1: 'R_MV_5_', //  MV
N
Nzix 已提交
9 10 11 12 13 14
        2: 'A_PL_0_', //  歌单
        3: 'R_AL_3_', //  专辑
        4: 'A_DJ_1_', //  电台,
        5: 'R_VI_62_' //  视频
    }[query.type]
    const data = {
N
Nzix 已提交
15
        threadId: query.type + query.id,
N
Nzix 已提交
16 17 18 19 20 21 22
        commentId: query.cid
    }
    return request(
        'POST', `http://music.163.com/weapi/v1/comment/${query.t}`, data,
        {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}
    )
}