From a5a9b5c2222f47eb87b9d201a409913541c28cf0 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Tue, 2 Apr 2024 09:51:35 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20V1.6.5=20=E6=B2=B9=E7=AE=A1?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E9=80=82=E9=85=8D=E7=9F=AD=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=EF=BC=88youtu.be=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 6 ++++-- config/version.yaml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index f3b4afe..259cd10 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -134,7 +134,7 @@ export class tools extends plugin { fnc: "general", }, { - reg: "(youtube.com)", + reg: "(youtube.com|youtu.be)", fnc: "y2b" }, { @@ -1086,7 +1086,9 @@ export class tools extends plugin { */ async y2b(e) { const urlRex = /(?:https?:\/\/)?(www\.)?youtube\.com\/[A-Za-z\d._?%&+\-=\/#]*/g; - let url = urlRex.exec(e.msg)[0]; + // https://youtu.be/9IoNgzpURDw?si=XlvOAxqqjF9FJYcF + const url2Rex = /(?:https?:\/\/)?youtu\.be\/[A-Za-z\d._?%&+\-=\/#]*/g; + let url = urlRex.exec(e.msg)?.[0] || url2Rex.exec(e.msg)?.[0]; // 判断海外 const isOversea = await this.isOverseasServer(); // 如果不是海外用户且没有梯子直接返回 diff --git a/config/version.yaml b/config/version.yaml index a3c4ad1..11549b5 100644 --- a/config/version.yaml +++ b/config/version.yaml @@ -1,5 +1,5 @@ - { - version: 1.6.4, + version: 1.6.5, data: [ 新增B站扫码功能,