From d2d314d0f64290b6f8302ad33425d7389905ec24 Mon Sep 17 00:00:00 2001 From: Shawn <45581750+KOP-XIAO@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:23:44 +0800 Subject: [PATCH] update --- Scripts/.DS_Store | Bin 6148 -> 8196 bytes Scripts/resource-parser.js | 60 +++++++++++++++++++++++++++---------- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/Scripts/.DS_Store b/Scripts/.DS_Store index b97b28510c5a15fe98317e9c0412e9f9de0440b1..dbb0d5c71c4ae5d5e15eb8e8ffb4ff50411543ee 100644 GIT binary patch literal 8196 zcmeHM&2AGh5FRIcD2Yg;AW(&b*dv!z;sKD-rU>PRR5*uZOExK6g7PE8EqBB#@B$nV zPr`|ZK^)+lv5R&c?~+~+sN>3>WY^zk`sqdG6c0+NuJoz_nC>&xaV5 zZO_?_wQ_WzkrV(n!euG=j66Uvv9mpAH`WRioHlzf4r*MAVJsZ?W9|;yb9Q5`g_E&x zGHzt!G87}D0~bqoGCgaxRRvUmZ3QIpr#>xcPOl63`;-ppoR)ljkj;~EHXj4d+v^DR z@TU|Z?9dr<{w44)=^Z%M_}0Z6fGNHw^vd#h9G^Xo2KruLtaD&X#x?gm%s!<+&1py( z+Jr`U?=a)}hDJ2+J@gG4&{JTK&<;X~=)Q+&IK&vEWS8?St}FWCVQzYuA?6vJU-ZF4 z+R^$|D%M88Jji*XDWmm8g9&DshSpX4T7p``hbv$&La6#94`uZmU^Nq9#Aih<>YqGB zOZx5}A0Klo>j-v;_*&5zUfU(cI8O5%4dJMaONp^O=C)|EK%9-B%M1+ZZV_(2d!ye4 z)8)IdX<>hK3;X8{Vv9WyP_&kMoOdcXQ+Q>L*=Cq~i0hlj)v4fO9|t(}yeX4r3kIE!TG}wa#7xN=*k!+oSg*}rl3U?xUvFui#Xu?|8e>I|10w< zKow90{vQQQbaHxfjQN_9IdiTZqrO1p!u>YZ3IvU$ z=LSh|F?ccrFgQ>CCnPiZgy8y(Wom4T**Q1_nSpXZAixbITtS9yEd0(qnP0|I0VE7G WjtNSG3;}UK)`DEZusNP*4l@Aq5EY96 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)