From 467b29de761f36b724a73d5d031b7fed17d63430 Mon Sep 17 00:00:00 2001 From: Shawn <45581750+KOP-XIAO@users.noreply.github.com> Date: Tue, 5 Jul 2022 11:51:38 +0800 Subject: [PATCH] minor bug fixed --- Scripts/resource-parser.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Scripts/resource-parser.js b/Scripts/resource-parser.js index 08070f0..a84e4a3 100644 --- a/Scripts/resource-parser.js +++ b/Scripts/resource-parser.js @@ -1,5 +1,5 @@ /** -☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-07-04 11:10⟧ +☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-07-05 11:40⟧ ---------------------------------------------------------- 🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot ⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API @@ -380,6 +380,7 @@ function ResourceParse() { total = SGMD2QX(content0) // 转换 total = Rewrite_Filter(total, Pin0, Pout0,Preg,Pregout); // 筛选过滤 if (Preplace) { total = ReplaceReg(total, Preplace) } + total = total.filter( (ele,pos)=>total.indexOf(ele) == pos); //重写重复检查 if (Pcdn) {total = CDN(total) } else { total = total.join("\n")} } else if (type0 == "rewrite") { // rewrite 类型 @@ -914,6 +915,7 @@ function SCP2QX(subs) { var nrw = [] var rw = "" subs = subs.split("\n").map(x => x.trim().replace(/\s+/g," ")) + //$notify("Script","",subs) for (var i = 0; i < subs.length; i++) { try { if (subs[i].slice(0, 8) == "hostname") { @@ -943,8 +945,9 @@ function SCP2QX(subs) { rw = ptn + " url " + type + js nrw.push(rw) } - } else if (subs[i].indexOf(" 302") != -1 || subs[i].indexOf(" 307") != -1) { //rewrite 302&307 复写 + } else if (/\s30(7|2)$/.test(subs[i])) { //rewrite 302&307 复写 //tpe = subs[i].indexOf(" 302") != -1? "302":"307" + //$notify("307/2",subs[i]) rw = subs[i].split(" ")[0] + " url " + subs[i].split(" ")[2] + " " + subs[i].split(" ")[1].trim() //if(rw.indexOf("307")!=-1) {$notify("XX",subs[i],rw.split(" "))} nrw.push(rw)