Update resource-parser.js

This commit is contained in:
Shawn Wen
2026-01-09 16:24:35 +08:00
parent b83b4706b1
commit dd5e48bea8

View File

@@ -1,5 +1,5 @@
/** /**
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2026-01-09 13:57 ☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2026-01-09 16:25
---------------------------------------------------------- ----------------------------------------------------------
🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/ShawnKOP_Parser_Bot 🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/ShawnKOP_Parser_Bot
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API ⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
@@ -2116,8 +2116,8 @@ function VL2QX(subs, Pudp, Ptfo, Pcert0, PTls13) {
ip = cnt.split("@")[1].split("encry")[0].split("?")[0]; ip = cnt.split("@")[1].split("encry")[0].split("?")[0];
pwd = cnt.split("@")[0]? "password=" + cnt.split("@")[0]:""; pwd = cnt.split("@")[0]? "password=" + cnt.split("@")[0]:"";
pcert = cnt.indexOf("allowInsecure=0") != -1 ? "tls-verification=true" : "tls-verification=false"; pcert = cnt.indexOf("allowInsecure=0") != -1 ? "tls-verification=true" : "tls-verification=false";
thost = cnt.indexOf("sni=") != -1? "tls-host="+cnt.split("sni=")[1].split(/&|#/)[0]:"" thost = cnt.indexOf("sni=") != -1? "obfs-host="+cnt.split("sni=")[1].split(/&|#/)[0]:""
thost = cnt.indexOf("peer=") != -1? "tls-host="+cnt.split("peer=")[1].split(/&|#/)[0]:thost thost = cnt.indexOf("peer=") != -1? "obfs-host="+cnt.split("peer=")[1].split(/&|#/)[0]:thost
tag = cnt.indexOf("#") != -1 ? "tag=" + decodeURIComponent(cnt.split("#").slice(-1)[0]) : "tag= [vless]" + ip tag = cnt.indexOf("#") != -1 ? "tag=" + decodeURIComponent(cnt.split("#").slice(-1)[0]) : "tag= [vless]" + ip
} else { // shadowrocket style } else { // shadowrocket style
typeU = "SR-URI" typeU = "SR-URI"
@@ -2127,7 +2127,6 @@ function VL2QX(subs, Pudp, Ptfo, Pcert0, PTls13) {
tag = cnt.indexOf("remarks=") != -1 ? "tag=" + decodeURIComponent(cnt.split("remarks=")[1].split("&")[0]) : "tag= [vless]" + ip tag = cnt.indexOf("remarks=") != -1 ? "tag=" + decodeURIComponent(cnt.split("remarks=")[1].split("&")[0]) : "tag= [vless]" + ip
tag = cnt.indexOf("remark=") != -1 ? "tag=" + decodeURIComponent(cnt.split("remark=")[1].split("&")[0]) : tag tag = cnt.indexOf("remark=") != -1 ? "tag=" + decodeURIComponent(cnt.split("remark=")[1].split("&")[0]) : tag
} }
puri = "" puri = ""
pudp = (Pudp == 1 || cnt.indexOf("udp=1")!=-1) ? "udp-relay=true" : "udp-relay=false"; pudp = (Pudp == 1 || cnt.indexOf("udp=1")!=-1) ? "udp-relay=true" : "udp-relay=false";
@@ -2146,7 +2145,6 @@ function VL2QX(subs, Pudp, Ptfo, Pcert0, PTls13) {
thost=cnt.indexOf("obfsParam=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("obfsParam=")[1].split("&")[0].split("#")[0]).replace(/\"|(Host\":)|\{|\}/g,"") thost=cnt.indexOf("obfsParam=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("obfsParam=")[1].split("&")[0].split("#")[0]).replace(/\"|(Host\":)|\{|\}/g,"")
thost=cnt.indexOf("sni=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("sni=")[1].split("&")[0].split("#")[0]).replace(/\"|(Host\":)|\{|\}/g,"") thost=cnt.indexOf("sni=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("sni=")[1].split("&")[0].split("#")[0]).replace(/\"|(Host\":)|\{|\}/g,"")
thost=cnt.indexOf("peer=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("peer=")[1].split("&")[0].split("#")[0]).replace(/\"|(Host\":)|\{|\}/g,"") thost=cnt.indexOf("peer=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("peer=")[1].split("&")[0].split("#")[0]).replace(/\"|(Host\":)|\{|\}/g,"")
puri = cnt.indexOf("path=") == -1? puri : "obfs-uri=" + decodeURIComponent(cnt.split("path=")[1].split("&")[0].split("#")[0]) puri = cnt.indexOf("path=") == -1? puri : "obfs-uri=" + decodeURIComponent(cnt.split("path=")[1].split("&")[0].split("#")[0])
} else if (cnt.indexOf("&type=ws")!=-1 || cnt.indexOf("?type=ws")!=-1 || cnt.indexOf("type=http")!=-1 || cnt.indexOf("security=tls")!=-1 || cnt.indexOf("security=reality")!=-1) {//v2rayN uri } else if (cnt.indexOf("&type=ws")!=-1 || cnt.indexOf("?type=ws")!=-1 || cnt.indexOf("type=http")!=-1 || cnt.indexOf("security=tls")!=-1 || cnt.indexOf("security=reality")!=-1) {//v2rayN uri
if(cnt.indexOf("type=http") != -1) { if(cnt.indexOf("type=http") != -1) {
@@ -2158,6 +2156,7 @@ function VL2QX(subs, Pudp, Ptfo, Pcert0, PTls13) {
} }
thost=cnt.indexOf("&host=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("&host=")[1].split("&")[0].split("#")[0]) thost=cnt.indexOf("&host=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("&host=")[1].split("&")[0].split("#")[0])
thost=cnt.indexOf("sni=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("sni=")[1].split("&")[0].split("#")[0]).replace(/\"|(Host\":)|\{|\}/g,"") thost=cnt.indexOf("sni=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("sni=")[1].split("&")[0].split("#")[0]).replace(/\"|(Host\":)|\{|\}/g,"")
thost = cnt.indexOf("peer=") != -1? "obfs-host="+cnt.split("peer=")[1].split(/&|#/)[0]:thost
puri = cnt.indexOf("&path=") == -1? puri : "obfs-uri=" + decodeURIComponent(cnt.split("&path=")[1].split("&")[0].split("#")[0]) puri = cnt.indexOf("&path=") == -1? puri : "obfs-uri=" + decodeURIComponent(cnt.split("&path=")[1].split("&")[0].split("#")[0])
} else if(cnt.indexOf("security=xtls")!=-1) { //暂不支持类型 } else if(cnt.indexOf("security=xtls")!=-1) { //暂不支持类型
type="NS" type="NS"