From fc5c378c1363047d1c1ee38130f26364c22fea17 Mon Sep 17 00:00:00 2001 From: cmliu Date: Tue, 22 Jul 2025 21:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=5Fworker.js=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9base64=E8=AE=A2=E9=98=85=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E7=9A=84=E6=94=AF=E6=8C=81=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E8=BD=AC=E6=8D=A2=E9=80=BB=E8=BE=91=E5=B9=B6?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _worker.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/_worker.js b/_worker.js index 94272e5..df0b5d3 100644 --- a/_worker.js +++ b/_worker.js @@ -104,7 +104,7 @@ export default { 订阅格式 = 'loon'; } else if (userAgent.includes('clash') || userAgent.includes('meta') || userAgent.includes('mihomo') || url.searchParams.has('clash')) { 订阅格式 = 'clash'; - } + } } let subConverterUrl; @@ -141,6 +141,19 @@ export default { const result = [...uniqueLines].join('\n'); //console.log(result); + if (订阅格式 == 'base64' && !userAgent.includes('subconverter') && 订阅转换URL.includes('://')) { + subConverterUrl = `${subProtocol}://${subConverter}/sub?target=mixed&url=${encodeURIComponent(订阅转换URL)}&insert=false&config=${encodeURIComponent(subConfig)}&emoji=true&list=false&tfo=false&scv=true&fdn=false&sort=false&new_name=true`; + try { + const subConverterResponse = await fetch(subConverterUrl); + if (subConverterResponse.ok) { + const subConverterContent = await subConverterResponse.text(); + result += '\n' + atob(subConverterContent); + } + } catch (error) { + console.log('订阅转换请回base64失败,检查订阅转换后端是否正常运行'); + } + } + let base64Data; try { base64Data = btoa(result);