mirror of
https://github.com/KOP-XIAO/QuantumultX.git
synced 2026-01-25 08:55:12 +00:00
Update resource-parser.js
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2024-01-23 12:50⟧
|
||||
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2024-01-28 10:50⟧
|
||||
----------------------------------------------------------
|
||||
🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot
|
||||
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
|
||||
@@ -1538,7 +1538,7 @@ function Subs2QX(subs, Pudp, Ptfo, Pcert0, PTls13) {
|
||||
var list0 = subs.split("\n");
|
||||
var QuanXK = ["shadowsocks=", "trojan=", "vmess=", "http=","socks5="];
|
||||
var SurgeK = ["=ss,", "=vmess,", "=trojan,", "=http,", "=https,", "=custom,", "=socks5", "=socks5-tls"];
|
||||
var LoonK = ["=shadowsocks", "=shadowsocksr"]
|
||||
var LoonK = ["=shadowsocks", "=shadowsocksr", "=vless"]
|
||||
var QXlist = [];
|
||||
var failedList = [];
|
||||
for (var i = 0; i < list0.length; i++) {
|
||||
@@ -2053,6 +2053,7 @@ function SSR2QX(subs, Pudp, Ptfo) {
|
||||
// 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
|
||||
//vls = VLESS,1.1.1.1,443,"b0dd64e4-0fbd-4038-9139-d1f32a68a0dc",transport=ws,path=patha,host=host.com,udp=true,over-tls=true,tls-name=sni.co
|
||||
function VL2QX(subs, Pudp, Ptfo, Pcert0, PTls13) {
|
||||
var nvless = []
|
||||
var cnt = subs.split("vless://")[1]
|
||||
@@ -2890,6 +2891,8 @@ function Loon2QX(cnt) {
|
||||
node = LoonSS2QX(cnt)
|
||||
} else if (type == "ShadowsocksR") { //ssr 类型
|
||||
node = LoonSSR2QX(cnt)
|
||||
} else if (type == "VLESS") { // vless 类型
|
||||
node = LoonVL2QX(cnt)
|
||||
}
|
||||
return node
|
||||
}
|
||||
@@ -2922,6 +2925,34 @@ function LoonSSR2QX(cnt) {
|
||||
return node
|
||||
}
|
||||
|
||||
//Loon 的 VLESS 部分
|
||||
//vls = VLESS,1.1.1.1,443,"b0dd64e4-0fbd-4038-9139-d1f32a68a0dc",transport=ws,path=patha,host=host.com,udp=true,over-tls=true,tls-name=sni.co
|
||||
function LoonVL2QX(cnt) {
|
||||
var tag = ", tag=" + cnt.split("=")[0].trim()
|
||||
cnt=cnt.replace(" ","") //去掉空格 简化
|
||||
var node = "vless="
|
||||
var ip = [cnt.split(",")[1].trim(), cnt.split(",")[2].trim()].join(":")
|
||||
var mtd = "method=none"
|
||||
var pwd = "password=" + cnt.split(",")[3].trim().split("\"")[1]
|
||||
if (cnt.indexOf("transport=tcp")!=-1) {
|
||||
obfs= cnt.indexOf("over-tls=true")=="-1"? "":"obfs=over-tls"
|
||||
} else if (cnt.indexOf("transport=http")!=-1) {
|
||||
obfs="obfs=http"
|
||||
} else if (cnt.indexOf("transport=ws")!=-1) {
|
||||
obfs= cnt.indexOf("over-tls=true")=="-1"? "obfs=ws":"obfs=wss"
|
||||
}
|
||||
vpath = cnt.indexOf("path=")==-1? "":"obfs-uri="+cnt.split("path=")[1].split(",")[0]
|
||||
if (cnt.indexOf("host=")!=-1) {
|
||||
obfshost="obfs-host="+cnt.split("host=")[1].split(",")[0]
|
||||
} else if (cnt.indexOf("tls-name=")!=-1) {
|
||||
obfshost="obfs-host="+cnt.split("tls-name=")[1].split(",")[0]
|
||||
}
|
||||
node = node + [ip, mtd, pwd, obfs, obfshost, vpath].join(", ") + tag
|
||||
return node
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
function YAMLFix(cnt){
|
||||
cnt = cnt.replace(/\[/g,"yaml@bug1").replace(/\\r/g,"").replace(/\*/g,"yaml@bug2")
|
||||
//2022-08-08 增加 .replace(/\*/g,"🌟@bug2") 以解决名字以 * 开始时引起的部分问题
|
||||
|
||||
Reference in New Issue
Block a user