feat(core): 新增 Sub-Store 节点命名处理系统

本次变更引入了一套完整的节点自动化重命名方案,旨在提升 Sub-Store 订阅管理的标准化程度:

1. 新增三个机场专属处理脚本:peiqian-rename.js、yuetong-rename.js 及整合版 rename.js,用于精简节点名称和统一格式。
2. 优化 sntp-rename.js:增加了 CT(CF) 和 D(直连) 等线路特征识别。
3. 更新 README.md:详细说明了脚本的链式调用顺序与各自职责。
4. 核心逻辑改进:支持国家/城市短码转换、国旗位置归位及防重复注入机制。
This commit is contained in:
2026-05-19 00:25:04 +08:00
parent 0ef15bfd3b
commit c6f9588738
5 changed files with 506 additions and 59 deletions
+33
View File
@@ -0,0 +1,33 @@
/**
* PeiQian 专用节点清理脚本
* 只处理 _subName 为 PeiQian 的节点,避免把“推荐/用途/hy2”等文案规则误伤到其他订阅。
*/
function operator(proxies) {
return proxies.map(proxy => {
if (proxy._subName !== 'PeiQian' || typeof proxy.name !== 'string') {
return proxy;
}
proxy.name = proxy.name
.replace(/^AWS\s*新加坡\s*/i, '新加坡 AWS ')
.replace(/\s*\|\s*合适下载使用\s*-\s*(\d+(?:\.\d+)?)倍/gi, ' $1x')
.replace(/\s*\|\s*合适下载使用/gi, '')
.replace(/\s*\|\s*避免晚高峰使用/gi, '')
.replace(/\s*\|\s*电信联通移动推荐\s*-\s*hy2/gi, ' [三网 HY2]')
.replace(/\s*\|\s*电信联通移动推荐/gi, ' [三网]')
.replace(/\s*\|\s*电信联通推荐\s*-\s*hy2/gi, ' [电联 HY2]')
.replace(/\s*\|\s*电信联通推荐/gi, ' [电联]')
.replace(/\s*\|\s*移动联通推荐\s*-\s*hy2/gi, ' [移联 HY2]')
.replace(/\s*\|\s*移动联通推荐/gi, ' [移联]')
.replace(/\s*\|\s*高速专线(?:推荐)?\s*-\s*hy2/gi, ' [HY2]')
.replace(/\s*\|\s*高速专线推荐/gi, ' [专线]')
.replace(/\s*\|\s*三网推荐/gi, ' [三网]')
.replace(/-\s*(\d+(?:\.\d+)?)倍/gi, ' $1x')
.replace(/(\d+(?:\.\d+)?)倍/gi, '$1x')
.replace(/\s+\[/g, ' [')
.replace(/\s{2,}/g, ' ')
.trim();
return proxy;
});
}