From 58ceb8f5ddc7640d1d80d203f604dee66c8f1b8c Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Mon, 28 Oct 2024 17:17:27 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E4=BD=BF=E7=94=A8=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E6=96=B9=E6=A1=88=E8=A7=A3=E5=86=B3=20dy=20=E5=8A=A8?= =?UTF-8?q?=E5=9B=BE=E6=97=A0=E6=B3=95=E8=A7=A3=E6=9E=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 5 +++++ utils/general-link-adapter.js | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/apps/tools.js b/apps/tools.js index 6d9acd6..7b07958 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -355,6 +355,11 @@ export class tools extends plugin { ttwid = ttwidValue; douUrl = location } + // TODO 如果有新的好解决方案可以删除,如果遇到https://www.iesdouyin.com/share/slides,这类动图暂时交付给其他API解析 + if (douUrl.includes("share/slides")) { + this.general(e); + return; + } // 获取 ID const douId = /note\/(\d+)/g.exec(douUrl)?.[1] || /video\/(\d+)/g.exec(douUrl)?.[1] || diff --git a/utils/general-link-adapter.js b/utils/general-link-adapter.js index 604d439..d3313ff 100644 --- a/utils/general-link-adapter.js +++ b/utils/general-link-adapter.js @@ -113,6 +113,12 @@ class GeneralLinkAdapter { return { name: "即刻", reqLink }; } + async douyinBackup(link) { + const msg = /(http:\/\/|https:\/\/)v.douyin.com\/[A-Za-z\d._?%&+\-=\/#]*/.exec(link)?.[0]; + const reqLink = this.createReqLink(GENERAL_REQ_LINK, msg); + return { name: "抖音动图", reqLink }; + } + /** * 初始化通用适配器 * @param link 通用链接 @@ -128,6 +134,7 @@ class GeneralLinkAdapter { [/tieba.baidu.com/, this.tieba.bind(this)], [/xsj.qq.com/, this.qqSmallWorld.bind(this)], [/m.okjike.com/, this.jike.bind(this)], + [/v.douyin.com/, this.douyinBackup.bind(this)], ]); for (let [regex, handler] of handlers) {