mirror of
https://github.com/KOP-XIAO/QuantumultX.git
synced 2026-01-25 17:15:09 +00:00
minor bug fixed
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-05-11 17:50⟧
|
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-05-12 11:50⟧
|
||||||
----------------------------------------------------------
|
----------------------------------------------------------
|
||||||
🛠 发现 𝐁𝐔𝐆 请反馈: @Shawn_Parser_Bot
|
🛠 发现 𝐁𝐔𝐆 请反馈: @Shawn_Parser_Bot
|
||||||
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
|
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
|
||||||
@@ -453,7 +453,7 @@ function Type_Check(subs) {
|
|||||||
if (subs.indexOf(html) != -1 && link0.indexOf("github.com" == -1)) {
|
if (subs.indexOf(html) != -1 && link0.indexOf("github.com" == -1)) {
|
||||||
$notify("‼️ 该链接返回网页内容,无有效订阅"+ " ➟ " + "⟦" + subtag + "⟧", "⁉️ 点通知跳转以确认链接是否失效\n"+link0, subs, nan_link);
|
$notify("‼️ 该链接返回网页内容,无有效订阅"+ " ➟ " + "⟦" + subtag + "⟧", "⁉️ 点通知跳转以确认链接是否失效\n"+link0, subs, nan_link);
|
||||||
type = "web";
|
type = "web";
|
||||||
} else if (typeU == "nodes" ) {
|
} else if (typeU == "nodes" ) { //指定为节点类型
|
||||||
type = (typeQ == "unsupported" || typeQ =="server")? "Subs-B64Encode":"wrong-field"
|
type = (typeQ == "unsupported" || typeQ =="server")? "Subs-B64Encode":"wrong-field"
|
||||||
} else if (ClashK.some(NodeCheck) || typeU == "clash"){ // Clash 类型节点转换
|
} else if (ClashK.some(NodeCheck) || typeU == "clash"){ // Clash 类型节点转换
|
||||||
type = (typeQ == "unsupported" || typeQ =="server")? "Clash":"wrong-field";
|
type = (typeQ == "unsupported" || typeQ =="server")? "Clash":"wrong-field";
|
||||||
@@ -463,8 +463,9 @@ function Type_Check(subs) {
|
|||||||
} else if ( (((ModuleK.some(RewriteCheck) || para1.indexOf("dst=rewrite") != -1) && (para1.indexOf("dst=filter") == -1) && subs.indexOf("[Proxy]") == -1) || typeU == "module") && typeU != "nodes" && typeU != "rule" && typeQ !="filter") { // Surge 类型 module /rule-set(含url-regex) 类型
|
} else if ( (((ModuleK.some(RewriteCheck) || para1.indexOf("dst=rewrite") != -1) && (para1.indexOf("dst=filter") == -1) && subs.indexOf("[Proxy]") == -1) || typeU == "module") && typeU != "nodes" && typeU != "rule" && typeQ !="filter") { // Surge 类型 module /rule-set(含url-regex) 类型
|
||||||
type = (typeQ == "unsupported" || typeQ =="rewrite")? "sgmodule" : "wrong-field"
|
type = (typeQ == "unsupported" || typeQ =="rewrite")? "sgmodule" : "wrong-field"
|
||||||
} else if (((RuleK.some(RuleCheck) && subs.indexOf(html) == -1 && !/\[(Proxy|server_local)\]/.test(subs)) || typeU == "rule" || para1.indexOf("dst=filter")!=-1) && typeU != "nodes") {
|
} else if (((RuleK.some(RuleCheck) && subs.indexOf(html) == -1 && !/\[(Proxy|server_local)\]/.test(subs)) || typeU == "rule" || para1.indexOf("dst=filter")!=-1) && typeU != "nodes") {
|
||||||
|
// rule/filter类型
|
||||||
type = (typeQ == "unsupported" || typeQ =="filter")? "Rule":"wrong-field";
|
type = (typeQ == "unsupported" || typeQ =="filter")? "Rule":"wrong-field";
|
||||||
} else if ((DomainK.some(RuleCheck) || typeU == "domain-set") && subs.indexOf("[Proxy]") == -1 && typeU != "nodes") {
|
} else if (typeU == "domain-set") {// 仅限用户指定为 domain-set;((DomainK.some(RuleCheck) || typeU == "domain-set") && subs.indexOf("[Proxy]") == -1 && typeU != "nodes") {
|
||||||
type = (typeQ == "unsupported" || typeQ =="filter")? "Rule":"wrong-field";
|
type = (typeQ == "unsupported" || typeQ =="filter")? "Rule":"wrong-field";
|
||||||
content0 = Domain2Rule(content0) // 转换 domain-set
|
content0 = Domain2Rule(content0) // 转换 domain-set
|
||||||
} else if (typeQ == "filter") { // 纯 list类型?
|
} else if (typeQ == "filter") { // 纯 list类型?
|
||||||
@@ -1000,7 +1001,7 @@ function Rule_Handle(subs, Pout, Pin) {
|
|||||||
Tout = Pout; //过滤参数
|
Tout = Pout; //过滤参数
|
||||||
ply = Ppolicy; //策略组
|
ply = Ppolicy; //策略组
|
||||||
var nlist = []
|
var nlist = []
|
||||||
var RuleK = ["//", "#", ";"];
|
var RuleK = ["//", "#", ";","["]; //排除项目
|
||||||
var RuleK2 = ["host,", "-suffix,", "domain,", "-keyword,", "ip-cidr,", "ip-cidr6,", "geoip,", "user-agent,", "ip6-cidr,"];
|
var RuleK2 = ["host,", "-suffix,", "domain,", "-keyword,", "ip-cidr,", "ip-cidr6,", "geoip,", "user-agent,", "ip6-cidr,"];
|
||||||
if (Tout != "" && Tout != null) { // 有 out 参数时
|
if (Tout != "" && Tout != null) { // 有 out 参数时
|
||||||
var dlist = [];
|
var dlist = [];
|
||||||
@@ -1010,7 +1011,7 @@ function Rule_Handle(subs, Pout, Pin) {
|
|||||||
const RuleCheck = (item) => cc.toLowerCase().indexOf(item) != -1; //无视注释行
|
const RuleCheck = (item) => cc.toLowerCase().indexOf(item) != -1; //无视注释行
|
||||||
if (Tout.some(exclude) && !RuleK.some(RuleCheck) && RuleK2.some(RuleCheck)) {
|
if (Tout.some(exclude) && !RuleK.some(RuleCheck) && RuleK2.some(RuleCheck)) {
|
||||||
dlist.push("-" + Rule_Policy(cc)) // 注释掉条目
|
dlist.push("-" + Rule_Policy(cc)) // 注释掉条目
|
||||||
} else if (!RuleK.some(RuleCheck) && cc) { //if Pout.some, 不操作注释项
|
} else if (!RuleK.some(RuleCheck) && cc && RuleK2.some(RuleCheck)) { //if Pout.some, 不操作注释项,不操作不识别规则项目
|
||||||
dd = Rule_Policy(cc);
|
dd = Rule_Policy(cc);
|
||||||
if (Tin != "" && Tin != null) {
|
if (Tin != "" && Tin != null) {
|
||||||
const include = (item) => dd.indexOf(item) != -1; // 保留项
|
const include = (item) => dd.indexOf(item) != -1; // 保留项
|
||||||
@@ -1082,7 +1083,7 @@ function Rule_Handle(subs, Pout, Pin) {
|
|||||||
|
|
||||||
function Rule_Policy(content) { //增加、替换 policy
|
function Rule_Policy(content) { //增加、替换 policy
|
||||||
var cnt = content.replace(/^\s*\-\s/g,"").replace(/REJECT-TINYGIF/gi,"reject").trim().split("//")[0].split(",");
|
var cnt = content.replace(/^\s*\-\s/g,"").replace(/REJECT-TINYGIF/gi,"reject").trim().split("//")[0].split(",");
|
||||||
var RuleK = ["//", "#", ";","[","/", "hostname"];
|
var RuleK = ["//", "#", ";","[","/", "hostname","no-ipv6","no-system"];
|
||||||
var RuleK1 = ["host", "domain", "ip-cidr", "geoip", "user-agent", "ip6-cidr"];
|
var RuleK1 = ["host", "domain", "ip-cidr", "geoip", "user-agent", "ip6-cidr"];
|
||||||
const RuleCheck = (item) => cnt[0].trim().toLowerCase().indexOf(item) == 0; //无视注释行
|
const RuleCheck = (item) => cnt[0].trim().toLowerCase().indexOf(item) == 0; //无视注释行
|
||||||
const RuleCheck1 = (item) => cnt[0].trim().toLowerCase().indexOf(item) == 0 ; //无视 quanx 不支持的规则类别&排除 hostname
|
const RuleCheck1 = (item) => cnt[0].trim().toLowerCase().indexOf(item) == 0 ; //无视 quanx 不支持的规则类别&排除 hostname
|
||||||
@@ -1109,7 +1110,7 @@ function Rule_Policy(content) { //增加、替换 policy
|
|||||||
nn = ""
|
nn = ""
|
||||||
} else { nn = nn.replace("IP-CIDR6", "ip6-cidr") }
|
} else { nn = nn.replace("IP-CIDR6", "ip6-cidr") }
|
||||||
return nn
|
return nn
|
||||||
} else if (cnt.length == 1 && !RuleK.some(RuleCheck) && cnt[0]!="" && cnt[0].indexOf("payload:")==-1) { // 纯域名/ip 列表
|
} else if (cnt.length == 1 && !RuleK.some(RuleCheck) && cnt[0]!="" && cnt[0].indexOf("payload:")==-1 && cnt[0].indexOf("=")==-1 && cnt[0].trim()!="https:") { // 纯域名/ip 列表
|
||||||
return rule_list_handle(cnt[0])
|
return rule_list_handle(cnt[0])
|
||||||
} else { return "" }//if RuleK1 check
|
} else { return "" }//if RuleK1 check
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user