🐞 fix: V1.6.1 修复检测梯子问题

修复了梯子检测的逻辑失误(🌷感谢群友@弃提供问题)
This commit is contained in:
zhiyu1998 2024-03-31 23:46:01 +08:00
parent 8f1bd00c2b
commit 38e45a57cc
3 changed files with 7 additions and 7 deletions

View File

@ -285,7 +285,7 @@ export class tools extends plugin {
// 判断海外 // 判断海外
const isOversea = await this.isOverseasServer(); const isOversea = await this.isOverseasServer();
// 如果不是海外用户且没有梯子直接返回 // 如果不是海外用户且没有梯子直接返回
if (!isOversea && await testProxy()) { if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) {
e.reply("检测到没有梯子无法解析TikTok"); e.reply("检测到没有梯子无法解析TikTok");
return false; return false;
} }
@ -608,7 +608,7 @@ export class tools extends plugin {
// 判断海外 // 判断海外
const isOversea = await this.isOverseasServer(); const isOversea = await this.isOverseasServer();
// 如果不是海外用户且没有梯子直接返回 // 如果不是海外用户且没有梯子直接返回
if (!isOversea && await testProxy()) { if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) {
e.reply("检测到没有梯子无法解析TikTok"); e.reply("检测到没有梯子无法解析TikTok");
return false; return false;
} }
@ -1069,7 +1069,7 @@ export class tools extends plugin {
// 判断海外 // 判断海外
const isOversea = await this.isOverseasServer(); const isOversea = await this.isOverseasServer();
// 如果不是海外用户且没有梯子直接返回 // 如果不是海外用户且没有梯子直接返回
if (!isOversea && await testProxy()) { if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) {
e.reply("检测到没有梯子无法解析TikTok"); e.reply("检测到没有梯子无法解析TikTok");
return false; return false;
} }

View File

@ -1,5 +1,5 @@
- { - {
version: 1.6.0, version: 1.6.1,
data: data:
[ [
新增<span class="cmd">微视解析</span>功能, 新增<span class="cmd">微视解析</span>功能,

View File

@ -305,11 +305,11 @@ export function truncateString(inputString, maxLength = 50) {
* 测试当前是否存在🪜 * 测试当前是否存在🪜
* @returns {Promise<Boolean>} * @returns {Promise<Boolean>}
*/ */
export async function testProxy() { export async function testProxy(host='127.0.0.1', port=7890) {
// 配置代理服务器 // 配置代理服务器
const proxyOptions = { const proxyOptions = {
host: '127.0.0.1', host: host,
port: 7890, port: port,
// 如果你的代理服务器需要认证 // 如果你的代理服务器需要认证
// auth: 'username:password', // 取消注释并提供实际的用户名和密码 // auth: 'username:password', // 取消注释并提供实际的用户名和密码
}; };