♻️ refactor(substore): 优化节点重命名规则并规范化地区序列号格式

This commit is contained in:
Orion
2026-06-03 11:18:28 +08:00
parent a41e7e7959
commit 51488a5ec2
2 changed files with 19 additions and 12 deletions
+5 -11
View File
@@ -1,6 +1,6 @@
/**
* PeiQian 专用节点清理脚本
* 负责清理推荐、用途、hy2、倍率等 PeiQian 节点文案。
* 负责清理推荐、用途、hy2、倍率、线路特征和提供商等 PeiQian 节点文案。
*/
// noinspection JSUnusedGlobalSymbols
function operator(proxies) {
@@ -10,21 +10,15 @@ function operator(proxies) {
}
proxy.name = proxy.name
.replace(/^AWS\s*新加坡\s*/i, '新加坡 AWS ')
.replace(/AWS\s*新加坡\s*/gi, '')
.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*\|\s*(?:电信联通移动|电信联通|移动联通|三网)推荐(?:\s*-\s*hy2)?/gi, '')
.replace(/\s*\|\s*高速专线(?:推荐)?(?:\s*-\s*hy2)?/gi, '')
.replace(/-\s*(\d+(?:\.\d+)?)倍/gi, ' $1x')
.replace(/(\d+(?:\.\d+)?)倍/gi, '$1x')
.replace(/\s*\[(?:专线|移联|电联|三网|HY2)(?:\s+(?:专线|移联|电联|三网|HY2))*\]/gi, '')
.replace(/\s+\[/g, ' [')
.replace(/\s{2,}/g, ' ')
.trim();