mirror of
https://github.com/KOP-XIAO/QuantumultX.git
synced 2026-01-25 17:15:09 +00:00
adjustment
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-06-29 11:10⟧
|
||||
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-07-01 11:10⟧
|
||||
----------------------------------------------------------
|
||||
🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot
|
||||
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
|
||||
@@ -25,10 +25,9 @@
|
||||
⦿ udp=1/-1, tfo=1/-1, 分别强制开启(关闭) 𝐮𝐝𝐩-𝐫𝐞𝐥𝐚𝐲/𝐟𝐚𝐬𝐭-𝐨𝐩𝐞𝐧;
|
||||
⦿ uot=1, 开启 udp-over-tcp=true选项(仅限SS(R))
|
||||
⦿ cert=1/-1, 分别开启/关闭 𝐭𝐥𝐬 证书验证(默认关闭);
|
||||
❖ csha/psha, tls-cert-sha256 以及 tls-pubkey-sha256 参数
|
||||
❖ csha/psha, tls-cert-sha256 以及 tls-pubkey-sha256 参数
|
||||
⦿ in, out, regex, regout 分别为 保留、删除、正则保留、正则删除 节点;
|
||||
❖ in, out 中多参数(逻辑"或")用 "+", 逻辑"与"用 "." 表示;
|
||||
❖ in/out 仅对节点名匹配生效
|
||||
❖ in/out 仅对节点名匹配生效, 多参数(逻辑"或")用 "+", 逻辑"与"用 "." 表示;
|
||||
❖ regex/regout 对节点的完整信息进行匹配(类型、端口、加密等);
|
||||
❖ 示范: "in=香港.0\.2倍率+台湾&out=BGP®ex=iplc"
|
||||
⦿ rename 重命名, "旧名@新名", "前缀@", "@后缀", 用 "+" 连接多个参数;
|
||||
@@ -41,7 +40,7 @@
|
||||
⦿ delreg, 利用正则表达式来删除 "节点名" 中的字段(⚠️ 慎用)
|
||||
⦿ aead=-1, 关闭 Vmess 的 AEAD 参数
|
||||
⦿ host=xxx , 修改 host 参数(如有)
|
||||
⦿ checkurl=xxx , 指定server_check_url 参数
|
||||
⦿ checkurl=xxx , 指定 server_check_url 参数
|
||||
⦿ sort=1/-1/x/参数规则, 按节点名 正/逆/随机/参数规则 排序
|
||||
❖ 参数规则是正则表达式或简单关键词, 用"<" 或 ">" 连接
|
||||
❖ sort=🇭🇰>🇸🇬>🇯🇵>🇺🇸 , 靠前排序
|
||||
@@ -74,13 +73,13 @@
|
||||
⦿ policy 参数, 用于直接指定策略组,或为 𝐒𝐮𝐫𝐠𝐞 类型 𝗿𝘂𝗹𝗲-𝘀𝗲𝘁 生成策略组(默认"𝐒𝐡𝐚𝐰𝐧"策略组);
|
||||
⦿ pset=regex1@policy1+regex2@policy2, 为同一分流规则中不同关键词(允许正则表达式)指定不同策略组;
|
||||
⦿ replace 参数, 正则替换 𝐟𝐢𝐥𝐭𝐞𝐫/𝐫𝐞𝐰𝐫𝐢𝐭𝐞 内容, regex@newregex;
|
||||
❖ 将淘宝比价中脚本替换成 lite 版本, tiktok 中 JP 换成 KR
|
||||
∎ replace=(price)(.*)@$1_lite$2+jp@kr
|
||||
❖ 将淘宝比价中脚本替换成 lite 版本(如有此版本的脚本)
|
||||
∎ replace=(price)(.*)@$1_lite$2
|
||||
⦿ dst=rewrite/filter,分别为将 𝐦𝐨𝐝𝐮𝐥𝐞&𝗿𝘂𝗹𝗲-𝘀𝗲𝘁 转换成 重写/分流;
|
||||
❖ ⚠️ 默认将 𝐦𝐨𝐝𝐮𝐥𝐞 转换到重写, 𝗿𝘂𝗹𝗲-𝘀𝗲𝘁 转成分流
|
||||
❖ ⚠️ 把 𝗿𝘂𝗹𝗲-𝘀𝗲𝘁 中 url-regex 转成重写时, 必须要加 dst=rewrite;
|
||||
❖ ⚠️ 把 𝐦𝐨𝐝𝐮𝐥𝐞 中的分流规则转换时, 必须要加 dst=filter
|
||||
⦿ cdn=1, 将 github 脚本的地址转换成免翻墙cdn.jsdelivr.net
|
||||
⦿ cdn=1, 将 github 脚本的地址转换成免翻墙 fastly.jsdelivr.net/gh
|
||||
⦿ fcr=1/2/3, 为分流规则添加 force-cellular/multi-interface/multi-interface-balance 参数,强制移动数据/混合数据/负载均衡
|
||||
⦿ via=接口, 为分流规则添加 via-interface 参数, 0 表示 via-interface=%TUN%
|
||||
⦿ relay=目标策略名, 批量将节点订阅转换为ip/host规则,用于实现代理链
|
||||
@@ -92,7 +91,7 @@
|
||||
⦿ 类型参数 type=domain-set/rule/module/list/nodes
|
||||
❖ 当解析器未能正确识别类型时, 可尝试使用此参数强制指定
|
||||
⦿ 隐藏参数 hide=0, 禁用筛除的分流/重写,默认方式为删除
|
||||
⦿ profile=111 , URL-Scheme 添加配置中远程资源
|
||||
⦿ profile=111 , URL-Scheme 添加QuanX配置中远程资源
|
||||
----------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -867,7 +866,7 @@ function ToRaw(cnt) {
|
||||
|
||||
function CDN(cnt) {
|
||||
console.log("CDN start")
|
||||
cnt = cnt.join("\n").replace(/https:\/\/raw.githubusercontent.com\/(.*?)\/(.*?)\/(.*)/gmi,"https://cdn.jsdelivr.net/gh/$1/$2@$3")
|
||||
cnt = cnt.join("\n").replace(/https:\/\/raw.githubusercontent.com\/(.*?)\/(.*?)\/(.*)/gmi,"https://fastly.jsdelivr.net/gh/$1/$2@$3")
|
||||
return cnt
|
||||
}
|
||||
|
||||
@@ -2510,27 +2509,6 @@ function LoonSSR2QX(cnt) {
|
||||
return node
|
||||
}
|
||||
|
||||
|
||||
// fix yaml parse mistakes
|
||||
// function YAMLFix(cnt){
|
||||
// cnt = cnt.replace(/\[/g,"yaml@bug1")
|
||||
// if (cnt.indexOf("{") != -1 && /\{\s*name/.test(cnt)){
|
||||
// cnt = cnt.replace(/(^|\n)- /g, "$1 - ").replace(/ - /g," - ").replace(/:(?!\s)/g,": ").replace(/\,\"/g,", \"").replace(/: {/g, ": {, ").replace(/, (Host|host|path|mux)/g,", $1") //2022-04-11 remove tls|skip from replace(/, (Host|host|path|mux)/g,", $1")
|
||||
// //console.log(cnt)
|
||||
// cnt = cnt.replace(/{\s*name: /g,"{name: \"").replace(/, server:/g,"\", server:")
|
||||
// cnt = cnt.replace(/{|}/g,"").replace(/,/g,"\n ")
|
||||
// }
|
||||
// cnt = cnt.replace(/ -\n.*name/g," - name").replace(/\$|\`/g,"").split("proxy-providers:")[0].split("proxy-groups:")[0].replace(/\"(name|type|server|port|cipher|password|)(\"*)/g,"$1")
|
||||
// console.log(cnt)
|
||||
// cnt = cnt.indexOf("proxies:") == -1? "proxies:\n" + cnt :"proxies:"+cnt.split("proxies:")[1]
|
||||
// cnt = cnt.replace(/name\:(.*?)\:(.*?)\n/gmi,"name:$1冒号$2\n").replace(/\s{6}Host\:/g," Host:") //罕见bug情况 修复
|
||||
// items=cnt.split("\n").map(yamlcheck)
|
||||
// cnt=items.join("\n")
|
||||
// //console.log(cnt.replace(/name\:(.*?)\:(.*?)\n/gmi,"name:$1冒号$2"))
|
||||
// console.log("after-fix"+cnt)
|
||||
// return cnt
|
||||
// }
|
||||
|
||||
function YAMLFix(cnt){
|
||||
cnt = cnt.replace(/\[/g,"yaml@bug1").replace(/\\r/g,"")
|
||||
if (cnt.indexOf("{") != -1 && /\{\s*\"*(name|type|server)/.test(cnt)){
|
||||
|
||||
Reference in New Issue
Block a user