Update resource-parser.js

This commit is contained in:
Shawn
2023-04-12 13:39:43 +08:00
parent 3a85bbc4ec
commit 3cf87856f9

View File

@@ -1,5 +1,5 @@
/** /**
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2023-04-11 11:35⟧ ☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2023-04-12 13:35⟧
---------------------------------------------------------- ----------------------------------------------------------
🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot 🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API ⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
@@ -1429,15 +1429,25 @@ function rule_list_handle(cnt) {
cnt = Ppolicy == "Shawn" ? cnt+", Shawn" : cnt+", "+Ppolicy cnt = Ppolicy == "Shawn" ? cnt+", Shawn" : cnt+", "+Ppolicy
} else if (cnt.indexOf("payload:")==-1) { //host - suffix, not clash rule list } else if (cnt.indexOf("payload:")==-1) { //host - suffix, not clash rule list
//$notify("xxx","xxxx",cnt) //$notify("xxx","xxxx",cnt)
cnt=cnt.replace(/'|"/g,"").trim()//replace(/'|"|\+\.|\*\.|\*\.\*/g,"") 2023-04-10 //cnt=cnt.replace(/'|"/g,"").trim()//replace(/'|"|\+\.|\*\.|\*\.\*/g,"") 2023-04-10
if(!/\*|\+/.test(cnt[0])) { if(!/^('|")/.test(cnt)) { // not clash-provider
cnt = cnt[0]=="." ? cnt.replace(".",""): cnt if(!/\*|\+/.test(cnt[0])) {
cnt = "host-suffix, " + cnt cnt = cnt[0]=="." ? cnt.replace(".",""): cnt
} else { cnt = "host-suffix, " + cnt
cnt = "host-wildcard, " + cnt } else {
cnt = "host-wildcard, " + cnt
}
} else { // clash provider
cnt=cnt.replace(/'|"/g,"").trim()
if ( /^(\*\.|\.)/.test(cnt) || cnt.indexOf("*")!=-1) {
cnt = "host-wildcard, " + cnt
} else {
cnt = "host-suffix, " + cnt.replace(/\+\./,"")
}
} }
cnt = Ppolicy == "Shawn" ? cnt+", Shawn" : cnt+", "+Ppolicy cnt = Ppolicy == "Shawn" ? cnt+", Shawn" : cnt+", "+Ppolicy
} }
} }
return cnt return cnt
} }