From 38e45a57cc80f5622a3c16843fa81de07fda2743 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Sun, 31 Mar 2024 23:46:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=20V1.6.1=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=A3=80=E6=B5=8B=E6=A2=AF=E5=AD=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了梯子检测的逻辑失误(🌷感谢群友@弃提供问题) --- apps/tools.js | 6 +++--- config/version.yaml | 2 +- utils/common.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index 1f775e7..af30d81 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -285,7 +285,7 @@ export class tools extends plugin { // 判断海外 const isOversea = await this.isOverseasServer(); // 如果不是海外用户且没有梯子直接返回 - if (!isOversea && await testProxy()) { + if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) { e.reply("检测到没有梯子,无法解析TikTok"); return false; } @@ -608,7 +608,7 @@ export class tools extends plugin { // 判断海外 const isOversea = await this.isOverseasServer(); // 如果不是海外用户且没有梯子直接返回 - if (!isOversea && await testProxy()) { + if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) { e.reply("检测到没有梯子,无法解析TikTok"); return false; } @@ -1069,7 +1069,7 @@ export class tools extends plugin { // 判断海外 const isOversea = await this.isOverseasServer(); // 如果不是海外用户且没有梯子直接返回 - if (!isOversea && await testProxy()) { + if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) { e.reply("检测到没有梯子,无法解析TikTok"); return false; } diff --git a/config/version.yaml b/config/version.yaml index a34da81..ccdfbcf 100644 --- a/config/version.yaml +++ b/config/version.yaml @@ -1,5 +1,5 @@ - { - version: 1.6.0, + version: 1.6.1, data: [ 新增微视解析功能, diff --git a/utils/common.js b/utils/common.js index 4935ddb..2732fc1 100644 --- a/utils/common.js +++ b/utils/common.js @@ -305,11 +305,11 @@ export function truncateString(inputString, maxLength = 50) { * 测试当前是否存在🪜 * @returns {Promise} */ -export async function testProxy() { +export async function testProxy(host='127.0.0.1', port=7890) { // 配置代理服务器 const proxyOptions = { - host: '127.0.0.1', - port: 7890, + host: host, + port: port, // 如果你的代理服务器需要认证 // auth: 'username:password', // 取消注释并提供实际的用户名和密码 };