重名节点操作

This commit is contained in:
Shawn
2021-02-22 09:52:31 +08:00
parent 83bb9c4016
commit cabebe81db
2 changed files with 11 additions and 4 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -1,5 +1,5 @@
/**
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2021-02-08 14:29⟧
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2021-02-22 14:29⟧
----------------------------------------------------------
🛠 发现 𝐁𝐔𝐆 请反馈: @Shawn_KOP_bot
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
@@ -37,6 +37,7 @@
∎ 样式分别为 "𝐬𝐬","𝐒𝐒","🅢🅢","🆂🆂","ⓢⓢ","🅂🅂"
❖ $emoji1/2 占位符将节点地区emoji(🇭🇰 🇯🇵 等)作为可操作参数,如
∎ 𝐫𝐞𝐧𝐚𝐦𝐞=@「$emoji1」
⦿ 𝗱𝗲𝗹=0, 有重名节点时,默认删除重复节点, 此参数为 0 则保留所有重名节点
⦿ 𝘀𝘂𝗳𝗳𝗶𝘅=-1/1 将节点类型做为前缀/后缀 添加在节点名中, 如 「𝗌𝗌」 「𝖵𝗆𝖾𝗌𝗌」
⦿ 𝗱𝗲𝗹𝗿𝗲𝗴, 利用正则表达式来删除 "节点名" 中的字段(⚠️ 慎用)
⦿ 𝗿𝗲𝗽𝗹𝗮𝗰𝗲 参数, 正则替换节点中内容, 可用于重命名/更改加密方式等
@@ -153,7 +154,7 @@ var pfihn = Phin0 ? "inhn=" + Phin0.join(", ") + ", " : ""
var pfohn = Phout0 ? "outhn=" + Phout0.join(", ") : ""
var Pcnt = para1.indexOf("cnt=") != -1 ? para1.split("cnt=")[1].split("&")[0] : 0;
let [flow, exptime, errornode, total] = "";
var Pdel = mark0 && para1.indexOf("del=") != -1 ? para1.split("del=")[1].split("&")[0] : 1; //删除重复节点
var typeU = para1.indexOf("type=") != -1 ? para1.split("type=")[1].split("&")[0] : "";
@@ -420,15 +421,17 @@ function TagCheck_QX(content) {
nulllist.push(nm.replace("shadowsocks", "ss"))
}
var ni = 0
while (nmlist.indexOf(nm) != -1) { //重名
while (nmlist.indexOf(nm) != -1) { //重名情形
nm = ni <= 10 ? nm.split(" ⌘")[0] + " ⌘" + emojino[ni] : nm.split(" ⌘")[0] + " ⌘" + ni
item = item.split("tag")[0] + "tag=" + nm
item = Pdel == 0 ? item.split("tag")[0] + "tag=" + nm : ""
ni = ni + 1
}
if (ni != 0) { duplist.push(nm) }
nmlist.push(nm)
ni = 0
if (item) {
Nlist.push(item)
}
}// if "tag="
} // for
if (nulllist.length >= 1) {
@@ -437,7 +440,11 @@ function TagCheck_QX(content) {
}
if (duplist.length >= 1) {
no = duplist.length <= 10 ? emojino[duplist.length] : duplist.length;
if (Pdel==0){
$notify("⚠️ 引用" + "⟦" + subtag + "⟧" + " 内有" + no + "个重复节点名 ", "✅ 已添加⌘符号作为区分:", " ⨁ " + duplist.join("\n ⨁ "), nan_link)
} else {
$notify("⚠️ 引用" + "⟦" + subtag + "⟧" + " 内有" + no + "个重复节点名 ", "✅ 已全部删除:", " ⨁ " + duplist.join("\n ⨁ "), nan_link)
}
}
return Nlist
}