mirror of
https://github.com/KOP-XIAO/QuantumultX.git
synced 2026-01-25 17:15:09 +00:00
Update resource-parser.js
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2021-03-28 14:20⟧
|
||||
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2021-03-28 18:20⟧
|
||||
----------------------------------------------------------
|
||||
🛠 发现 𝐁𝐔𝐆 请反馈: @Shawn_KOP_bot
|
||||
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
|
||||
@@ -383,7 +383,7 @@ function Type_Check(subs) {
|
||||
} else if (ClashK.some(NodeCheck) || typeU == "clash"){ // Clash 类型节点转换
|
||||
type = "Clash";
|
||||
content0 = Clash2QX(subs)
|
||||
} else if ((/hostname\=|pattern\=/.test(subs) || RewriteK.some(RewriteCheck)) && !/\[(Proxy|filter_local)\]/.test(subs) && para1.indexOf("dst=filter")==-1 && subi.indexOf("securehostname") == -1 && !/module|nodes/.test(typeU)) {
|
||||
} else if ((/^hostname\s*\=|pattern\=/.test(subi) || RewriteK.some(RewriteCheck)) && !/\[(Proxy|filter_local)\]/.test(subs) && para1.indexOf("dst=filter")==-1 && subi.indexOf("securehostname") == -1 && !/module|nodes/.test(typeU)) {
|
||||
type = "rewrite" //Quantumult X 类型 rewrite/ Surge Script/
|
||||
} else if ( (((ModuleK.some(RewriteCheck) || para1.indexOf("dst=rewrite") != -1) && (para1.indexOf("dst=filter") == -1) && subs.indexOf("[Proxy]") == -1) || typeU == "module") && typeU != "nodes") { // Surge 类型 module /rule-set(含url-regex) 类型
|
||||
type = "sgmodule"
|
||||
@@ -718,7 +718,7 @@ function Rewrite_Filter(subs, Pin, Pout,Preg) {
|
||||
if (noteK.some(notecheck)) { // 注释项跳过
|
||||
continue;
|
||||
} else if (hnc == 0 && subii.indexOf("hostname=") == 0) { //hostname 部分
|
||||
hostname = (Phin0 || Phout0) ? HostNamecheck(subi, Phin0, Phout0) : subi;//hostname 部分
|
||||
hostname = (Phin0 || Phout0 || Preg) ? HostNamecheck(subi, Phin0, Phout0) : subi;//hostname 部分
|
||||
} else if (subii.indexOf("hostname=") != 0) { //rewrite 部分
|
||||
var inflag = Rcheck(subi, Pin);
|
||||
var outflag = Rcheck(subi, Pout);
|
||||
@@ -790,7 +790,7 @@ function HostNamecheck(content, parain, paraout) {
|
||||
$notify("🤖 " + "重写引用 ➟ " + "⟦" + subtag + "⟧", "⛔️ 筛选参数: " + pfihn + pfohn, "⚠️ 主机名 hostname 中剩余 0️⃣ 项, 请检查参数及原始链接", nan_link)
|
||||
}
|
||||
if(Preg){ nname = nname.map(Regex).filter(Boolean)
|
||||
RegCheck(nname, "主机名", Preg) }
|
||||
RegCheck(nname, "主机名hostname", Preg) }
|
||||
hname = "hostname=" + nname.join(", ");
|
||||
return hname
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user