From e6f3f5c049f4cec2d2f817c006b70c1f4d3c65ca Mon Sep 17 00:00:00 2001 From: RrOrange <542716863@qq.com> Date: Wed, 5 Apr 2023 15:01:35 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E6=B7=BB=E5=8A=A0=E5=93=94?= =?UTF-8?q?=E5=93=A9=E5=93=94=E5=93=A9=E4=B8=8D=E5=8A=A0https=E7=9A=84?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20[#I6SFIU]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/tools.js b/apps/tools.js index d7fd1fd..89d5012 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -280,7 +280,7 @@ export class tools extends plugin { // bilibi解析 async bili(e) { - const urlRex = /(http:|https:)\/\/www.bilibili.com\/[A-Za-z\d._?%&+\-=\/#]*/g; + const urlRex = /(?:https?:\/\/)?www\.bilibili\.com\/[A-Za-z\d._?%&+\-=\/#]*/g; const bShortRex = /(http:|https:)\/\/b23.tv\/[A-Za-z\d._?%&+\-=\/#]*/g; let url = e.msg === undefined ? e.message.shift().data.replaceAll("\\", "") : e.msg.trim(); // 短号处理 @@ -292,6 +292,9 @@ export class tools extends plugin { } else if (url.includes("www.bilibili.com")) { url = urlRex.exec(url)[0]; } + // 补充https + url = url.startsWith("https://") ? url : "https://" + url; + logger.info(url) // av处理 const matched = url.match(/(av|AV)(\w+)/); if (matched) {