Merge pull request #65 from A1Panda/master

允许解析Youtube 小蓝鸟 Tiktok 强制使用海外服务器 不使用代理
This commit is contained in:
RrOrange 2025-05-14 23:20:10 +08:00 committed by GitHub
commit 1e63bf96f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 2 deletions

View File

@ -314,6 +314,8 @@ export class tools extends plugin {
this.aiApiKey = this.toolsConfig.aiApiKey; this.aiApiKey = this.toolsConfig.aiApiKey;
// ai模型 // ai模型
this.aiModel = this.toolsConfig.aiModel; this.aiModel = this.toolsConfig.aiModel;
// 强制使用海外服务器
this.forceOverseasServer = this.toolsConfig.forceOverseasServer;
} }
// 翻译插件 // 翻译插件
@ -3152,12 +3154,16 @@ export class tools extends plugin {
* @return {Promise<Boolean>} * @return {Promise<Boolean>}
*/ */
async isOverseasServer() { async isOverseasServer() {
// 如果配置了强制使用海外服务器则返回true
if (this.forceOverseasServer) {
return true;
}
// 如果第一次使用没有值就设置 // 如果第一次使用没有值就设置
if (!(await redisExistKey(REDIS_YUNZAI_ISOVERSEA))) { if (!(await redisExistKey(REDIS_YUNZAI_ISOVERSEA))) {
await redisSetKey(REDIS_YUNZAI_ISOVERSEA, { await redisSetKey(REDIS_YUNZAI_ISOVERSEA, {
os: false, os: false, // 默认不使用海外服务器
}); });
return true; return false;
} }
// 如果有就取出来 // 如果有就取出来
return (await redisGetKey(REDIS_YUNZAI_ISOVERSEA)).os; return (await redisGetKey(REDIS_YUNZAI_ISOVERSEA)).os;

View File

@ -5,6 +5,7 @@ videoSizeLimit: 70 # 视频大小限制单位MB超过大小则转换成
proxyAddr: '127.0.0.1' # 魔法地址 proxyAddr: '127.0.0.1' # 魔法地址
proxyPort: '7890' # 魔法端口 proxyPort: '7890' # 魔法端口
identifyPrefix: '' # 识别前缀,比如你识别哔哩哔哩,那么就有:✅ 识别:哔哩哔哩 identifyPrefix: '' # 识别前缀,比如你识别哔哩哔哩,那么就有:✅ 识别:哔哩哔哩
forceOverseasServer: false # 是否强制使用海外服务器设置为true时Twitter、TikTok等平台将强制使用代理
deeplApiUrls: 'http://www.gptspt.cn/translate,http://gptspt.top/translate,http://8.134.135.4:1188/translate,http://120.76.141.173:1188/translate,http://bit.x7ys.com:1188/translate,http://deeplxapi.x7ys.com:1188/translate' deeplApiUrls: 'http://www.gptspt.cn/translate,http://gptspt.top/translate,http://8.134.135.4:1188/translate,http://120.76.141.173:1188/translate,http://bit.x7ys.com:1188/translate,http://deeplxapi.x7ys.com:1188/translate'

View File

@ -64,6 +64,13 @@ export function supportGuoba() {
placeholder: "请输入端口默认7890", placeholder: "请输入端口默认7890",
}, },
}, },
{
field: "tools.forceOverseasServer",
label: "强制使用海外服务器",
bottomHelpMessage: "设置为开启时Twitter、TikTok等平台将强制不使用代理",
component: "Switch",
required: false,
},
{ {
field: "tools.identifyPrefix", field: "tools.identifyPrefix",
label: "识别前缀", label: "识别前缀",