From bb60556e4e3257ce3262d2fb738d151763a029c8 Mon Sep 17 00:00:00 2001 From: Shawn <45581750+KOP-XIAO@users.noreply.github.com> Date: Wed, 9 Jun 2021 22:24:12 +0800 Subject: [PATCH] bug fixed --- Scripts/resource-parser.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Scripts/resource-parser.js b/Scripts/resource-parser.js index 9a42c85..e72701a 100644 --- a/Scripts/resource-parser.js +++ b/Scripts/resource-parser.js @@ -1,5 +1,5 @@ /** -☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2021-05-01 21:20⟧ +☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2021-06-09 22:40⟧ ---------------------------------------------------------- 🛠 发现 𝐁𝐔𝐆 请反馈: @Shawn_KOP_bot ⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API @@ -431,6 +431,7 @@ function Type_Check(subs) { // 检查节点名字(重复以及空名)等QuanX 不允许的情形,以及多个空格等“不规范”方式 function TagCheck_QX(content) { + typefix = {"shadowsocks":["𝐬𝐬","𝐒𝐒","🅢🅢","🆂🆂","ⓢⓢ","🅂🅂","SS"],"shadowsocksr":["𝐬𝐬𝐫","𝐒𝐒𝐑","🅢🅢🅡","🆂🆂🆁","ⓢⓢⓡ","🅂🅂🅁","SSR"],"vmess":["𝐯𝐦𝐞𝐬𝐬","𝐕𝐌𝐄𝐒𝐒","🅥🅜🅔🅢🅢","🆅🅼🅴🆂🆂","ⓥⓜⓔⓢⓢ","🅅🄼🄴🅂🅂","VMESS"],"trojan":["𝐭𝐫𝐨𝐣𝐚𝐧","𝐓𝐑𝐎𝐉𝐀𝐍","🅣🅡🅞🅙🅐🅝","🆃🆁🅾🅹🅰🅽","ⓣⓡⓞⓙⓐⓝ","🅃🅁🄾🄹🄰🄽","TROJAN"],"http":["𝐡𝐭𝐭𝐩","𝐇𝐓𝐓𝐏","🅗🅣🅣🅟","🅷🆃🆃🅿","ⓗⓣⓣⓟ","🄷🅃🅃🄿","HTTP"]} console.log(content) var Olist = content.map(item =>item.trim().replace(/\s{2,}/g," ")) //$notify("","",Olist) @@ -439,17 +440,19 @@ function TagCheck_QX(content) { var no = 0; for (var i = 0; i < Olist.length; i++) { var item = Olist[i] ? Olist[i] : "" + typefix["shadowsocks"]=item.indexOf("ssr-protocol")!=-1? typefix["shadowsocksr"] : typefix["shadowsocks"] if (item.replace(/ /gm, "").indexOf("tag=") != -1) { var nl = item.slice(item.indexOf("tag")) var nm = nl.slice(nl.indexOf("=") + 1) if (nm == "") { //空名字 - nm = " [" + item.split("=")[0] + "] " + item.split("=")[1].split(",")[0].split(":")[0] + tp = typefix[item.split("=")[0].trim()][3] + nm = tp + " | " + item.split("=")[1].split(",")[0].split(":")[0] item = item.split("tag")[0] + "tag=" + nm.replace("shadowsocks", "ss") nulllist.push(nm.replace("shadowsocks", "ss")) } var ni = 0 while (nmlist.indexOf(nm) != -1) { //重名情形 - nm = nm+ NoReplace(ni+1) + nm = ni==0? nm+ NoReplace(ni+1):nm.split(" ").slice(0,nm.split(" ").length-2).join(" ") + NoReplace(ni+1) item = Pdel != 1 ? item.split("tag")[0] + "tag=" + nm : "" ni = ni + 1 }