From 5963cbad895660e8e8415381a446141f9f78fdab Mon Sep 17 00:00:00 2001 From: zhiyu1998 Date: Fri, 25 Nov 2022 22:55:41 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E5=93=94=E5=93=A9=E5=93=94?= =?UTF-8?q?=E5=93=A9=E9=80=82=E9=85=8D=E7=A7=BB=E5=8A=A8=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index 24fa1a0..d64557c 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -30,7 +30,7 @@ export class tools extends plugin { fnc: "tiktok", }, { - reg: "(.*)(bilibili.com)", + reg: "(.*)(bilibili.com|b23.tv)", fnc: "bili", }, ], @@ -99,7 +99,16 @@ export class tools extends plugin { // bilibi解析 async bili (e) { const urlRex = /(http:|https:)\/\/www.bilibili.com\/[A-Za-z\d._?%&+\-=\/#]*/g; - const url = urlRex.exec(e.msg.trim())[0] + const bShortRex = /(http:|https:)\/\/b23.tv\/[A-Za-z\d._?%&+\-=\/#]*/g; + let url = e.msg.trim() + if (url.includes('b23.tv')) { + const bShortUrl = bShortRex.exec(e.msg.trim())[0] + await this.douyinRequest(bShortUrl).then((res) => { + url = res.replace("m", "www") + }); + } else { + url = urlRex.exec(url)[0]; + } const path = `${ this.defaultPath }${ this.e.group_id || this.e.user_id }/temp` // 待优化