mirror of
https://github.com/KOP-XIAO/QuantumultX.git
synced 2026-01-25 13:05:10 +00:00
Update resource-parser.js
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2026-01-08 19:50⟧
|
||||
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2026-01-08 20:50⟧
|
||||
----------------------------------------------------------
|
||||
🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/ShawnKOP_Parser_Bot
|
||||
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
|
||||
@@ -3050,8 +3050,11 @@ function YAMLFix(cnt){
|
||||
cnt = cnt.replace(/\n\s*\-\s*\n.*name/g,"\n - name").replace(/\$|\`/g,"").split("proxy-providers:")[0].split("proxy-groups:")[0].replace(/\"(name|type|server|port|cipher|password|uuid|alterId|udp)(\"*)/g,"$1")
|
||||
if(Pdbg == 1) {
|
||||
$notify("part-fix0:","","part-fix0:\nproxies:\n"+cnt.split("proxies:")[1])}
|
||||
// 2023-03-23 👇修正部分类型
|
||||
cnt = cnt.replace(/\n\s{2}([a-zA-Z]+.*\:)/g,"\n $1").replace(/\n(\-.*)/g,"\n $1")
|
||||
// 缩进修正
|
||||
// old 2023-03-23 👇修正部分类型
|
||||
// cnt = cnt.replace(/\n\s{2}([a-zA-Z]+.*\:)/g,"\n $1").replace(/\n(\-.*)/g,"\n $1")
|
||||
//new 2026-01-08
|
||||
cnt = /\n\-\s[a-zA-Z]/.test(cnt)? cnt.replace(/\n(.*(\:|\-))/g,"\n $1"):cnt.replace(/\n\s{2}([a-zA-Z]+.*\:)/g,"\n $1").replace(/\n(\-.*)/g,"\n $1")
|
||||
if(Pdbg == 1) {
|
||||
$notify("part-fix1:","","part-fix1:\nproxies:\n"+cnt.split("proxies:")[1])}
|
||||
// cnt = cnt.indexOf("proxies:") == -1? "proxies:\n" + cnt :"proxies:"+cnt.split("proxies:")[1]
|
||||
@@ -3084,7 +3087,7 @@ function yamlcheck(cnt){
|
||||
}
|
||||
|
||||
}
|
||||
if (/(:|-)/.test(cnt)) {
|
||||
if (/(:)/.test(cnt) && !/alpn\s*\:/.test(cnt)) {
|
||||
return cnt
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user