From f51fd735bde4b6b2cb94fe82267dfba3249e05c1 Mon Sep 17 00:00:00 2001 From: Shawn <45581750+KOP-XIAO@users.noreply.github.com> Date: Thu, 10 Dec 2020 21:09:56 +0800 Subject: [PATCH] bug fixed --- .DS_Store | Bin 12292 -> 12292 bytes Scripts/resource-parser.js | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.DS_Store b/.DS_Store index 151def66d4f2d71ac348cc1082524d2c1ef57538..9622398ff7f3ffa4804fc0c89f254f1cd9881ee4 100644 GIT binary patch delta 57 zcmZokXi3=cRD5!>LaUIOj)H}8t&T#qp_zq&j)J9$(d1tWrkgiNM6qw?R=C9uR3yKd JMdKlu0RSiOPMw{13#IkSZQn<|yR3N{ZMdKlu F0RY}U5Q+c* diff --git a/Scripts/resource-parser.js b/Scripts/resource-parser.js index b3d7df4..8d69099 100644 --- a/Scripts/resource-parser.js +++ b/Scripts/resource-parser.js @@ -1,5 +1,5 @@ /** -☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2020-12-07 14:59⟧ +☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2020-12-10 20:59⟧ ---------------------------------------------------------- 🛠 发现 𝐁𝐔𝐆 请反馈: @Shawn_KOP_bot ⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API @@ -146,7 +146,7 @@ let [flow, exptime, errornode, total] = ""; var typeU = para1.indexOf("type=") != -1 ? para1.split("type=")[1].split("&")[0] : ""; var type0 = Type_Check(content0); // 类型判断 -//$notify(type0,"hh",content0) +//$notify(type0,"hh") //flag=1,2,3分别为 server、rewrite、rule 类型 var flag = 1 @@ -324,10 +324,10 @@ function Type_Check(subs) { } else if (ClashK.some(NodeCheck) || typeU == "clash"){ // Clash 类型节点转换 type = "Clash"; content0 = Clash2QX(subs) + } else if ((subi.indexOf("hostname=") != -1 || RewriteK.some(RewriteCheck) || subi.indexOf("pattern=") != -1) && subs.indexOf("[Proxy]") == -1 && subs.indexOf("[server_local]") == -1 && para1.indexOf("dst=filter")==-1 && subi.indexOf("securehostname") == -1) { + 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") { // Surge 类型 module /rule-set(含url-regex) 类型 type = "sgmodule" - } else if ((subi.indexOf("hostname=") != -1 || RewriteK.some(RewriteCheck) || subi.indexOf("pattern=") != -1) && subs.indexOf("[Proxy]") == -1 && subs.indexOf("[server_local]") == -1 && subs.indexOf("\nhttp-r") == -1 && para1.indexOf("dst=filter")==-1 && subi.indexOf("securehostname") == -1) { - type = "rewrite" //Quantumult X 类型 rewrite/ Surge Script/ } else if ((RuleK.some(RuleCheck) && subs.indexOf(html) == -1 && subs.indexOf("[Proxy]") == -1 && subs.indexOf("[server_local]") == -1) || typeU == "rule" ||para1.indexOf("dst=filter")!=-1) { type = "Rule"; } else if ((DomainK.some(RuleCheck) || typeU == "domain-set") && subs.indexOf("[Proxy]") == -1 ) { @@ -1177,7 +1177,7 @@ function isQuanXRewrite(content) { cnt0=[] for (var i = 0; i< cnt.length; i++){ var cnti = cnt[i] - if (cnti.indexOf("pattern")!=-1 && cnti.indexOf("type")!=-1) { + if ((cnti.indexOf("pattern")!=-1 && cnti.indexOf("type")!=-1) || cnti.indexOf("http-r")!=-1) { cnti=SGMD2QX(cnti)[0]? SGMD2QX(cnti)[0]:"" //console.log(cnti) }else if ((cnti.indexOf(" 302")!=-1 || cnti.indexOf(" 307")!=-1) && cnti.indexOf(" url ")==-1){