From 6c1e055281ef760df33b8c670b781214562b6d57 Mon Sep 17 00:00:00 2001 From: Orion Date: Wed, 3 Jun 2026 13:32:40 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(substore):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=87=8D=E5=91=BD=E5=90=8D=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=BA=BF=E8=B7=AF=E6=A0=87=E7=AD=BE=E4=B8=8E?= =?UTF-8?q?=E5=86=97=E4=BD=99=E5=B0=BE=E5=8F=B7=E6=B8=85=E6=B4=97=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- substore/README.md | 12 ++++++------ substore/rename.js | 5 +++-- substore/sntp-rename.js | 8 ++++++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/substore/README.md b/substore/README.md index 625a034..393d98b 100644 --- a/substore/README.md +++ b/substore/README.md @@ -25,7 +25,7 @@ https://git.orionc.me/orion/script/raw/branch/main/substore/common.js | 脚本 | 建议配置位置 | 作用 | | --- | --- | --- | -| `sntp-rename.js` | SNTP 单订阅 | 注入 `[三网]`、`[CF]`、`[直连]`、`[cn2]` 等线路标签 | +| `sntp-rename.js` | SNTP 单订阅 | 注入 `[三网]`、`[CFW]`、`[直连]`、`[cn2]` 等线路标签 | | `yuetong-rename.js` | YueTong 单订阅 | 去掉 `悦·`、`💎`,把 `AI解锁` 压成 `AI` | | `peiqian-rename.js` | PeiQian 单订阅 | 压短 `电信联通推荐`、`移动联通推荐`、`高速专线`、`hy2`、倍率和用途描述 | | `alphaair-rename.js` | Alpha Air 单订阅 | 去掉提供者/三网/家宽文案,普通节点保留地区,高级非倍率节点保留供应商,倍率节点保留倍率并连续编号 | @@ -41,7 +41,7 @@ https://git.orionc.me/orion/script/raw/branch/main/substore/common.js | --- | --- | | `GTM 0.5x` | `[三网]` | | `GTM` | `[三网]` | -| `CT` | `[CF]` | +| `CT` | `[CFW]` | | `D` | `[直连]` | | `S1` | `[广移]` | | `S2` | `[广电]` | @@ -54,7 +54,7 @@ https://git.orionc.me/orion/script/raw/branch/main/substore/common.js ```text 🇭🇰 HK-CT-1 0.2x - SNTP -=> 🇭🇰 HK-CT-1 0.2x [CF] - SNTP +=> 🇭🇰 HK-CT-1 0.2x [CFW] - SNTP 🇯🇵 JP-D-1-0.2x - SNTP => 🇯🇵 JP-D-1-0.2x [直连] - SNTP @@ -145,7 +145,7 @@ https://git.orionc.me/orion/script/raw/branch/main/substore/common.js - 支持国旗在中间的节点名,例如 `Pro-🇭🇰 Sharon|守夜人` -> `🇭🇰 HK Pro-Sharon|守夜人`。 - 将倍率移动到节点核心末尾、订阅后缀之前,例如 `US 2X 02 - Alpha Air` -> `US 02 2X - Alpha Air`。 - 清理 `[DIP China-Hongkong]` 为 `[DIP]`。 -- 清理 `IEPL 专线` 这类冗余描述。 +- 清理 Alpha Flower 这类 `IEPL 专线 3`、`标准 1`、`高级 1` 的冗余线路尾号。 - 追加订阅后缀 `- _subName`。 - 对最终重名节点追加两位编号。 @@ -155,8 +155,8 @@ https://git.orionc.me/orion/script/raw/branch/main/substore/common.js 🇭🇰 Hong Kong 01 [DIP China-Hongkong] - Nexitally => 🇭🇰 HK 01 [DIP] - Nexitally -🇭🇰 香港实验性 IEPL 专线 1 - Alpha Flower -=> 🇭🇰 HK 实验性 1 - Alpha Flower +🇯🇵 日本高级 IEPL 专线 3 - Alpha Flower +=> 🇯🇵 JP 01 高级 - Alpha Flower Pro-🇭🇰 Sharon|守夜人 - Alpha 8K Snell => 🇭🇰 HK Pro-Sharon|守夜人 - Alpha 8K Snell diff --git a/substore/rename.js b/substore/rename.js index c3a8646..25fa158 100644 --- a/substore/rename.js +++ b/substore/rename.js @@ -754,7 +754,7 @@ async function operator(proxies) { } core = core - .replace(/^([A-Z]{2})\s*(实验性|标准|高级)\s+IEPL\s+专线\s*(\d+)(.*)$/i, '$1 $2 $3$4') + .replace(/^([A-Z]{2})\s*(实验性|标准|高级)\s+IEPL\s+专线\s*\d+(.*)$/i, '$1 $2$3') .replace(/搬瓦工荷兰/g, '搬瓦工') .replace(/\s{2,}/g, ' ') .trim(); @@ -770,7 +770,8 @@ async function operator(proxies) { core = joinAlias(flagRegionCode, core); } - core = normalizeRegionSequence(moveMultiplierToEnd(simplifyCoreName(core))); + core = normalizeRegionSequence(moveMultiplierToEnd(simplifyCoreName(core))) + .replace(/^([A-Z]{2}(?:\s+[A-Z]{3})?\s+\d{2}\s+(?:标准|高级))\s+1(?=$|\s)/i, '$1'); return flag ? `${flag} ${core}` : core; }; diff --git a/substore/sntp-rename.js b/substore/sntp-rename.js index 03c1248..304fa37 100644 --- a/substore/sntp-rename.js +++ b/substore/sntp-rename.js @@ -33,7 +33,7 @@ async function operator(proxies) { const featureMap = { "GTM 0.5x": "三网", "GTM": "三网", - "CT": "CF", + "CT": "CFW", "S1": "广移", "S2": "广电", "S3": "广移", @@ -112,11 +112,15 @@ async function operator(proxies) { // 缓存后缀匹配正则,避免循环内重复创建 const suffixRegex = /\s*-\s*(SNTP.*)$/i; const normalizeSntpSuffixSpacing = proxyName => proxyName.replace(suffixRegex, '-$1'); + const normalizeCloudflareLabel = proxyName => proxyName + .replace(/\s*\[(?:CF|Cloudflare)]\s*/gi, ' [CFW] ') + .replace(/\s{2,}/g, ' ') + .trim(); // 3. 执行节点遍历与注入 return proxies.map(proxy => { if (typeof proxy.name !== 'string') return proxy; - let proxyName = normalizeSntpSuffixSpacing(proxy.name); + let proxyName = normalizeCloudflareLabel(normalizeSntpSuffixSpacing(proxy.name)); // 单次复合正则扫描提取 const featureMatch = proxyName.match(featureRegex);