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站扫码功能,