From f9412d3c1d454900a8fbc5b5aa7cd782dbec62cc Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Wed, 3 Apr 2024 20:36:21 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20V1.6.6=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D`downloadVideo`=E5=87=BD=E6=95=B0=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复`downloadVideo`函数在国内服务器的缺陷 2. 修复YouTube、tiktok在国内服务器无法使用问题 --- apps/tools.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index 60afd6b..6d57c86 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -731,7 +731,7 @@ export class tools extends plugin { if (url && (url.endsWith(".jpg") || url.endsWith(".png"))) { e.reply(segment.image(url)); } else { - this.downloadVideo(url).then(path => { + this.downloadVideo(url, !isOversea).then(path => { e.reply(segment.video(path + "/temp.mp4")); }); } @@ -1189,7 +1189,7 @@ export class tools extends plugin { if (formats.length > 0) { // 大概率是720p const videoUrl = formats?.[formats.length - 1].url; - this.downloadVideo(videoUrl).then(path => { + this.downloadVideo(videoUrl, !isOversea).then(path => { e.reply(segment.video(path + "/temp.mp4")); }); } @@ -1549,7 +1549,7 @@ export class tools extends plugin { httpAgent: tunnel.httpOverHttp({ proxy: { host: this.proxyAddr, port: this.proxyPort }, }), - httpsAgent: tunnel.httpOverHttp({ + httpsAgent: tunnel.httpsOverHttp({ proxy: { host: this.proxyAddr, port: this.proxyPort }, }), }),