From 0167c9e99e8a962f2d729044ef28932c5b405bd8 Mon Sep 17 00:00:00 2001
From: zhiyu1998 <542716863@qq.com>
Date: Sun, 24 Mar 2024 11:43:41 +0800
Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20V1.5.11=20=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E5=B0=8F=E4=B8=96=E7=95=8C=E8=A7=A3=E6=9E=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
1. 应群友要求,新增这个解析
2. 修正一些变量名
---
apps/tools.js | 2 +-
config/version.yaml | 3 ++-
utils/general-link-adapter.js | 21 ++++++++++++++-------
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/apps/tools.js b/apps/tools.js
index bafeb72..a00404a 100644
--- a/apps/tools.js
+++ b/apps/tools.js
@@ -128,7 +128,7 @@ export class tools extends plugin {
fnc: "bodianMusic",
},
{
- reg: "(kuaishou.com|ixigua.com|share.xiaochuankeji.cn|h5.pipix.com|h5.pipigx.com|tieba.baidu.com)",
+ reg: "(kuaishou.com|ixigua.com|share.xiaochuankeji.cn|h5.pipix.com|h5.pipigx.com|tieba.baidu.com|s.xsj.qq.com)",
fnc: "general",
},
{
diff --git a/config/version.yaml b/config/version.yaml
index f008956..fc6c5ea 100644
--- a/config/version.yaml
+++ b/config/version.yaml
@@ -1,7 +1,8 @@
- {
- version: 1.5.10,
+ version: 1.5.11,
data:
[
+ 新增小世界解析功能,
新增贴吧解析功能,
优化哔哩哔哩简介功能,
新增皮皮搞笑解析功能,
diff --git a/utils/general-link-adapter.js b/utils/general-link-adapter.js
index 6ca8290..406ff5d 100644
--- a/utils/general-link-adapter.js
+++ b/utils/general-link-adapter.js
@@ -4,7 +4,7 @@ import {
} from "../constants/tools.js";
/**
- * 第三方接口适配器,用户大面积覆盖解析视频的内容
+ * 第三方接口适配器,用于大面积覆盖解析视频的内容
*/
class GeneralLinkAdapter {
@@ -27,14 +27,14 @@ class GeneralLinkAdapter {
}
/**
- * 辅助函数,创造一个第三方接口的链接
- * @param originalLink 第三方接口:这个链接来自常量 constants/tools.js @GENERAL_REQ_LINK / ...
- * @param videoReq 请求的链接
+ * 【辅助函数】创造一个第三方接口的链接
+ * @param externalInterface 第三方接口:这个链接来自常量 constants/tools.js @GENERAL_REQ_LINK / ...
+ * @param requestURL 请求的链接
* @returns {*}
*/
- createReqLink(originalLink, videoReq) {
- let reqLink = { ...originalLink };
- reqLink.link = reqLink.link.replace("{}", videoReq);
+ createReqLink(externalInterface, requestURL) {
+ let reqLink = { ...externalInterface };
+ reqLink.link = reqLink.link.replace("{}", requestURL);
return reqLink;
}
@@ -106,6 +106,12 @@ class GeneralLinkAdapter {
return { name: "贴吧", reqLink };
}
+ async qqSmallWorld(link) {
+ const msg = /https:\/\/s.xsj\.qq\.com\/[A-Za-z0-9]+/.exec(link)?.[0];
+ const reqLink = this.createReqLink(GENERAL_REQ_LINK, msg);
+ return { name: "QQ小世界", reqLink };
+ }
+
/**
* 初始化通用适配器
* @param link 通用链接
@@ -120,6 +126,7 @@ class GeneralLinkAdapter {
[/h5.pipix.com/, this.pipixia.bind(this)],
[/h5.pipigx.com/, this.pipigx.bind(this)],
[/tieba.baidu.com/, this.tieba.bind(this)],
+ [/xsj.qq.com/, this.qqSmallWorld.bind(this)],
]);
for (let [regex, handler] of handlers) {