From 020e8257016f78eaa6b1552cd0a54c885fc3b0e7 Mon Sep 17 00:00:00 2001 From: binaryify Date: Fri, 2 Sep 2022 15:16:00 +0800 Subject: [PATCH] =?UTF-8?q?resourceType=E8=A1=A5=E5=85=85=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 49 +++++++++++++++++++++++++++++------------ module/resource_like.js | 9 ++------ util/config.json | 3 ++- 3 files changed, 39 insertions(+), 22 deletions(-) diff --git a/docs/README.md b/docs/README.md index 806de53..8dcc172 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1694,9 +1694,13 @@ tags: 歌单标签 3: 专辑 -4: 电台 +4: 电台节目 5: 视频 + +6: 动态 + +7: 电台 ``` **可选参数 :** `limit`: 取出评论数量 , 默认为 20 @@ -1811,9 +1815,13 @@ tags: 歌单标签 3: 专辑 -4: 电台 +4: 电台节目 5: 视频 + +6: 动态 + +7: 电台 ``` **可选参数 :** `limit`: 取出评论数量 , 默认为 20 @@ -1844,11 +1852,13 @@ tags: 歌单标签 3: 专辑 -4: 电台 +4: 电台节目 5: 视频 6: 动态 + +7: 电台 ``` **可选参数 :** @@ -1886,11 +1896,13 @@ tags: 歌单标签 3: 专辑 -4: 电台 +4: 电台节目 5: 视频 6: 动态 + +7: 电台 ``` **接口地址 :** `/comment/like` @@ -1990,23 +2002,24 @@ tags: 歌单标签 `type`: 数字,资源类型,对应歌曲,mv,专辑,歌单,电台,视频对应以下类型 - ``` - 0: 歌曲 + ``` + 0: 歌曲 - 1: mv + 1: mv - 2: 歌单 + 2: 歌单 - 3: 专辑 + 3: 专辑 - 4: 电台 + 4: 电台节目 + 5: 视频 - 5: 视频 + 6: 动态 - 6: 动态 + 7: 电台 - ``` + ``` `id`:对应资源 id `content` :内容 id,可通过 `/comment/mv` 等接口获取 @@ -2047,13 +2060,21 @@ tags: 歌单标签 ``` +0: 歌曲 + 1: mv -4: 电台 +2: 歌单 + +3: 专辑 + +4: 电台节目 5: 视频 6: 动态 + +7: 电台 ``` diff --git a/module/resource_like.js b/module/resource_like.js index 920b94f..37299b5 100644 --- a/module/resource_like.js +++ b/module/resource_like.js @@ -1,14 +1,9 @@ // 点赞与取消点赞资源 - +const { resourceTypeMap } = require('../util/config.json') module.exports = (query, request) => { query.cookie.os = 'android' 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] + query.type = resourceTypeMap[query.type] const data = { threadId: query.type + query.id, } diff --git a/util/config.json b/util/config.json index 8bb5952..4411fb6 100644 --- a/util/config.json +++ b/util/config.json @@ -7,6 +7,7 @@ "3": "R_AL_3_", "4": "A_DJ_1_", "5": "R_VI_62_", - "6": "A_EV_2_" + "6": "A_EV_2_", + "7": "A_DR_14_" } }