From 99ec5bf065f144418bde43f56f694b851b4c1d42 Mon Sep 17 00:00:00 2001 From: binaryify Date: Fri, 13 Nov 2020 14:46:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8A=B1=E4=B8=80=E6=8A=B1?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/comment_hug_list.js | 34 ++++++++++++++++++++++++++++++++++ module/hug_comment.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 module/comment_hug_list.js create mode 100644 module/hug_comment.js diff --git a/module/comment_hug_list.js b/module/comment_hug_list.js new file mode 100644 index 0000000..b0360f7 --- /dev/null +++ b/module/comment_hug_list.js @@ -0,0 +1,34 @@ +module.exports = (query, request) => { + query.cookie.os = 'ios' + query.cookie.appver = '7.3.27' + 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 threadId = query.type + query.id + const data = { + targetUserId: query.uid, + commentId: query.cid, + cursor: '-1', + threadId: threadId, + pageNo: 1, + idCursor: -1, + pageSize: 100, + } + return request( + 'POST', + `https://music.163.com/api/v2/resource/comments/hug/list`, + data, + { + crypto: 'api', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }, + ) +} diff --git a/module/hug_comment.js b/module/hug_comment.js new file mode 100644 index 0000000..0b2590a --- /dev/null +++ b/module/hug_comment.js @@ -0,0 +1,30 @@ +module.exports = (query, request) => { + query.cookie.os = 'ios' + query.cookie.appver = '7.3.27' + 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 threadId = query.type + query.id + const data = { + targetUserId: query.uid, + commentId: query.cid, + threadId: threadId, + } + return request( + 'POST', + `https://music.163.com/api/v2/resource/comments/hug/listener`, + data, + { + crypto: 'api', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }, + ) +}