diff --git a/Scripts/.DS_Store b/Scripts/.DS_Store index b97b285..dbb0d5c 100644 Binary files a/Scripts/.DS_Store and b/Scripts/.DS_Store differ diff --git a/Scripts/resource-parser.js b/Scripts/resource-parser.js index 770c55a..80ed613 100644 --- a/Scripts/resource-parser.js +++ b/Scripts/resource-parser.js @@ -1,5 +1,5 @@ /** -☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2024-01-18 10:00⟧ +☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2024-01-23 12:50⟧ ---------------------------------------------------------- 🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot ⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API @@ -1593,7 +1593,7 @@ function Subs2QX(subs, Pudp, Ptfo, Pcert0, PTls13) { } } else if (type == "vless" && version<821) { Perror = 1 ; // 无需反馈 - $notify("⚠️ Quantumult X 暂未支持 Vless 类型节点","请 ⚠️不要⚠️ 跑来 解析器🤖️ 反馈",list0[i]) + $notify("⚠️ 你的 Quantumult X 版本暂未支持 Vless 节点","请 ⚠️不要⚠️ 跑来 解析器🤖️ 反馈",list0[i]) } else if (type == "vless" ) { // version 150 support vless node=VL2QX(list0[i], Pudp, Ptfo, Pcert0, PTls13) } else if (QuanXK.some(NodeCheck1)) { @@ -2049,34 +2049,50 @@ function SSR2QX(subs, Pudp, Ptfo) { // Vless uri 转换成 QUANX 格式 // vless://pwd@a.b.c.gq:443?encryption=none&security=tls&type=ws&host=a.b.c.d&path=dsjdaaaaj#VLESS_WSS +// Vless Shadowrocket URI +// vless://YXV0bzpkampkakAxLjEuMS4xOjY2NjY?remarks=vless&obfsParam=123.com&path=/jsjdj&obfs=websocket&tls=1&peer=abc.com&tfo=1 //;vless=example.com:443, method=none, password=23ad6b10-8d1a-40f7-8ad0-e3e35cd32291, obfs=wss, obfs-uri=/ws, fast-open=false, udp-relay=false, tag=vless-ws-tls-01 - +//vless://YXV0bzpkampkakAxLjEuMS4xOjY2NjY?remarks=vless&obfsParam=hshdh&path=/jsjdj&obfs=http&tls=1&peer=abc.com&tfo=1 function VL2QX(subs, Pudp, Ptfo, Pcert0, PTls13) { var nvless = [] var cnt = subs.split("vless://")[1] type = "vless="; - ip = cnt.split("@")[1].split("encry")[0].split("?")[0]; - pwd = cnt.split("@")[0]? "password=" + cnt.split("@")[0]:""; mtd= "method=none" obfs="" + thost="" + if(cnt.indexOf("remarks=")==-1 && cnt.indexOf("@")!=-1) { // normal URI + typeU = "URI" + ip = cnt.split("@")[1].split("encry")[0].split("?")[0]; + pwd = cnt.split("@")[0]? "password=" + cnt.split("@")[0]:""; 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("peer=") != -1? "tls-host="+cnt.split("peer=")[1].split(/&|#/)[0]:thost - ptls13 = PTls13 == 1 ? "tls13=true" : "tls13=false" - puri = "" - if (Pcert0 == 0) { - pcert = "tls-verification=false" - } else if (Pcert0 == 1) { - pcert = "tls-verification=true" + tag = cnt.indexOf("#") != -1 ? "tag=" + decodeURIComponent(cnt.split("#").slice(-1)[0]) : "tag= [vless]" + ip + } else { // shadowrocket style + typeU = "SR-URI" + tag = cnt.indexOf("remarks=") != -1 ? "tag=" + decodeURIComponent(cnt.split("remarks=")[1].split("&")[0]) : "tag= [vless]" + ip + b64part = Base64.decode(cnt.split("?")[0]) + ip = b64part.split("@")[1] + pwd = "password=" + b64part.split("@")[0].split(":")[1] } + + puri = "" + pudp = (Pudp == 1 || cnt.indexOf("udp=1")!=-1) ? "udp-relay=true" : "udp-relay=false"; ptfo = (Ptfo == 1 || cnt.indexOf("tfo=1")!=-1)? "fast-open=true" : "fast-open=false"; //ptfo = cnt.indexOf("tfo=1") != -1? "fast-open=true" : ptfo - tag = cnt.indexOf("#") != -1 ? "tag=" + decodeURIComponent(cnt.split("#").slice(-1)[0]) : "tag= [vless]" + ip - if (cnt.indexOf("&plugin=obfs-local")!=-1) {//小火箭内的websocket写法 - obfs = cnt.indexOf("obfs=websocket") != -1? "obfs=wss" : obfs - thost=cnt.indexOf("obfs-host=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("obfs-host=")[1].split(";")[0].split("#")[0]) - puri = cnt.indexOf("path=") == -1? puri : "obfs-uri=" + decodeURIComponent(cnt.split("path=")[1].split(";")[0].split("#")[0]) + if (typeU == "SR-URI") {//小火箭内的websocket写法 + if(cnt.indexOf("obfs=none")!=-1 && cnt.indexOf("tls=1")==-1) { + obfs = "" + } else if(cnt.indexOf("obfs=none")!=-1 && cnt.indexOf("tls=1")!=-1) { + obfs = "obfs=over-tls" + } else if(cnt.indexOf("obfs=http")!=-1) { + obfs = "obfs=http" + } else if(cnt.indexOf("obfs=websocket")!=-1) { + obfs = cnt.indexOf("tls=1") != -1? "obfs=wss" : "obfs=ws" + } + thost=cnt.indexOf("obfsParam=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("obfsParam=")[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) {//v2rayN uri if(cnt.indexOf("type=http") != -1) { obfs="obfs=http" @@ -2092,6 +2108,18 @@ function VL2QX(subs, Pudp, Ptfo, Pcert0, PTls13) { } else if(cnt.indexOf("type=")!=-1 && cnt.indexOf("type=tcp")==-1) {//暂不支持类型 type="NS" } +if(obfs=="obfs=wss" && obfs=="obfs=over-tls"){ + ptls13 = PTls13 == 1 ? "tls13=true" : "tls13=false" + if (Pcert0 == 0) { + pcert = "tls-verification=false" + } else if (Pcert0 == 1) { + pcert = "tls-verification=true" + } +} else { + pcert="" + ptls13="" +} + nvless.push(type + ip, pwd, mtd, obfs, pcert, thost, puri, pudp, ptfo, tag) QX = type!="NS"? nvless.filter(Boolean).join(", ") : "" //$notify("VLESS","subtitle",QX)