minor bug fixed

This commit is contained in:
Shawn
2022-07-05 11:51:38 +08:00
parent 6e8f205f67
commit 467b29de76

View File

@@ -1,5 +1,5 @@
/** /**
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-07-04 11:10⟧ ☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-07-05 11:40⟧
---------------------------------------------------------- ----------------------------------------------------------
🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot 🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API ⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
@@ -380,6 +380,7 @@ function ResourceParse() {
total = SGMD2QX(content0) // 转换 total = SGMD2QX(content0) // 转换
total = Rewrite_Filter(total, Pin0, Pout0,Preg,Pregout); // 筛选过滤 total = Rewrite_Filter(total, Pin0, Pout0,Preg,Pregout); // 筛选过滤
if (Preplace) { total = ReplaceReg(total, Preplace) } if (Preplace) { total = ReplaceReg(total, Preplace) }
total = total.filter( (ele,pos)=>total.indexOf(ele) == pos); //重写重复检查
if (Pcdn) {total = CDN(total) if (Pcdn) {total = CDN(total)
} else { total = total.join("\n")} } else { total = total.join("\n")}
} else if (type0 == "rewrite") { // rewrite 类型 } else if (type0 == "rewrite") { // rewrite 类型
@@ -914,6 +915,7 @@ function SCP2QX(subs) {
var nrw = [] var nrw = []
var rw = "" var rw = ""
subs = subs.split("\n").map(x => x.trim().replace(/\s+/g," ")) subs = subs.split("\n").map(x => x.trim().replace(/\s+/g," "))
//$notify("Script","",subs)
for (var i = 0; i < subs.length; i++) { for (var i = 0; i < subs.length; i++) {
try { try {
if (subs[i].slice(0, 8) == "hostname") { if (subs[i].slice(0, 8) == "hostname") {
@@ -943,8 +945,9 @@ function SCP2QX(subs) {
rw = ptn + " url " + type + js rw = ptn + " url " + type + js
nrw.push(rw) 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" //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() 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(" "))} //if(rw.indexOf("307")!=-1) {$notify("XX",subs[i],rw.split(" "))}
nrw.push(rw) nrw.push(rw)