From 426e01bedeba00a5f635082f1b8150f5f9efcc4f Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Thu, 8 Aug 2024 23:37:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BF=AE=E5=A4=8Dytb?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=9A=84=E9=99=90=E5=88=B6=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index 42097c9..b1a0064 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -1340,7 +1340,6 @@ export class tools extends plugin { // 油管解析 async sy2b(e) { - let videoSizeLimit = 30 const isOversea = await this.isOverseasServer(); if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) { e.reply("检测到没有梯子,无法解析油管"); @@ -1360,7 +1359,7 @@ export class tools extends plugin { const title = execSync(`yt-dlp --get-title ${url} ${isOversea ? "" : `--proxy ${this.myProxy}`}`) e.reply(`识别:油管,视频下载中请耐心等待 \n${title}`); await this.dy2b(path, url, isOversea); - this.sendVideoToUpload(e, `${path}/temp.mp4`, videoSizeLimit) + this.sendVideoToUpload(e, `${ path }/temp.mp4`); } catch (error) { console.error(error); throw error; // Rethrow the error so it can be handled by the caller @@ -2101,7 +2100,9 @@ export class tools extends plugin { return e.reply('视频不存在'); } const stats = fs.statSync(path); - const videoSize = (stats.size / (1024 * 1024)).toFixed(2); + const videoSize = Math.floor(stats.size / (1024 * 1024)); + logger.info(typeof videoSize); + logger.info(typeof videoSizeLimit); if (videoSize > videoSizeLimit) { e.reply(`当前视频大小:${ videoSize }MB,\n大于设置的最大限制,\n改为上传群文件`); await this.uploadGroupFile(e, path);