diff --git a/.DS_Store b/.DS_Store index a1b33bc..0828499 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Scripts/resource-parser.js b/Scripts/resource-parser.js index 93e9c56..4661289 100644 --- a/Scripts/resource-parser.js +++ b/Scripts/resource-parser.js @@ -1,5 +1,5 @@ /** -☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2026-01-14 15:37⟧ +☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2026-01-29 18:09⟧ ---------------------------------------------------------- 🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/ShawnKOP_Parser_Bot ⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API @@ -222,6 +222,7 @@ var Psession = mark0 && para1.indexOf("tsession=") != -1 && version >= 771? par // 0/1 代表关闭 session-ticket/reuse,2 表示全部关闭。 var Pmix = version>=844? 1 : 0 // allow rewrite and filter mix from version 844 var Pjsonjq = version>=845? 0 : 1 // allow jsonjq from version 845 +var PNS=0 // 不支持的节点统计 var RegoutList= [] ;//用于 regout参数删选提醒 // URL-Scheme 增加配置 @@ -431,7 +432,7 @@ function ResourceParse() { total = total.length<100? total.filter( (ele,pos)=>total.indexOf(ele) == pos) : total total = total.join("\n") } else if (content0.trim() == "") { - $notify("‼️ 引用" + "⟦" + subtag + "⟧" + " 返回內容为空", "⁉️ 点通知跳转以确认链接是否失效", para.split("#")[0], nan_link); + $notify("‼️ 当前引用" + "⟦" + subtag + "⟧" + " 返回內容为空", "⁉️ 点通知跳转以确认链接是否失效", "如确认链接有效,请在链接后添加 ?flag=shadowrocket 或 &flag=shadowrocket ", nan_link); flag = 0; } else if (type0 == "sub-http") { let url = VCheck(String(Base64.decode(content0.split("sub://")[1].split("#")[0])+", opt-parser=true, tag="+(new Date()).getTime())) @@ -499,8 +500,9 @@ function ResourceParse() { //$notify("before","haha",total) total = TagCheck_QX(total).join("\n") //节点名检查 if (PUOT==1) { total = total.split("\n").map(UOT).join("\n")} - if (Pcnt == 1) {$notify("⟦" + subtag + "⟧"+"解析后最终返回内容" , "节点数量: " +total.split("\n").length, total)} + if (Pcnt == 1 && total!=undefined) {$notify("⟦" + subtag + "⟧"+"解析后最终返回内容" , "节点数量: " +total.split("\n").length, total)} total = PRelay==""? Base64.encode(total) : ServerRelay(total.split("\n"),PRelay) //强制节点类型 base64 加密后再导入 Quantumult X, 如果是relay,则转换成分流类型 + if (PNS !=0) {$notify("⚠️ 存在Quantumult X不支持的节点类型", "⚠️ 已忽略相关节点数,共计:"+PNS+" 条", "⚠️ 当前版本不支持 HY2,Anytls 等类型")} if(Pflow==1) { //$notify("添加流量信息","xxx","xxxx") $done({ content: total, info: {bytes_used: 3073741824, bytes_remaining: 2147483648, expire_date: 1854193966}}); @@ -508,6 +510,7 @@ function ResourceParse() { } else { $done({ content: total });} } else { if(Perror == 0) { + if (PNS !=0) {$notify("⚠️ 存在Quantumult X不支持的节点类型", "⚠️ 已忽略相关节点数,共计:"+PNS+" 条", "⚠️ 当前版本不支持 HY2,Anytls 等类型")} $notify("❓❓ 友情提示 ➟ "+ "⟦" + subtag + "⟧", "⚠️⚠️ 解析后无有效内容", "🚥🚥 请自行检查相关参数, 或者点击通知跳转并发送链接反馈", bug_link) } total = errornode @@ -520,7 +523,7 @@ function ResourceParse() { total = content0 $done({ content: content0 }) } - if (Pcnt == 1 && flag !=1) {$notify("解析后最终返回内容" , "总数量: " +total.split("\n").length, total)} + if (Pcnt == 1 && flag !=1 && total!=undefined) {$notify("解析后最终返回内容" , "总数量: " +total.split("\n").length, total)} return total } @@ -1641,7 +1644,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 节点","请更新app到最新版本",list0[i]) } else if (type == "vless" ) { // version 150 support vless node=VL2QX(list0[i], Pudp, Ptfo, Pcert0, PTls13) } else if (QuanXK.some(NodeCheck1)) { // QuanX type @@ -1650,7 +1653,9 @@ function Subs2QX(subs, Pudp, Ptfo, Pcert0, PTls13) { node = QX_TLS(Surge2QX(list0[i])[0], Pcert0, PTls13) } else if (LoonK.some(NodeCheck)) { // Loon type node = Loon2QX(list0[i]) - } + } else if (type=="hysteria2" || type=="anytls") { // + PNS=PNS+1 + } if (Pdbg) {$notify(i, type, node)} } catch (e) { failedList.push(`<<<\nContent: ${list0[i]}\nError: ${e}`) @@ -1922,6 +1927,8 @@ function V2QX(subs, Pudp, Ptfo, Pcert0, PTls13) { nss.push(ip, mtd, pwd, tfo, udp, caead, tag) } else if(obfs != "NOT-SUPPORTTED"){ nss.push(ip, mtd, pwd, obfs, tfo, udp, caead, tag); + } else if(obfs == "NOT-SUPPORTTED"){ + PNS=PNS+1 } QX = nss.join(", "); } @@ -2142,7 +2149,9 @@ function VL2QX(subs, Pudp, Ptfo, Pcert0, PTls13) { obfs = "obfs=http" } else if(cnt.indexOf("obfs=websocket")!=-1) { obfs = cnt.indexOf("tls=1") != -1? "obfs=wss" : "obfs=ws" - } + } else { //不支持类型 + type="NS" + } thost=cnt.indexOf("obfsParam=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("obfsParam=")[1].split("&")[0].split("#")[0]).replace(/\"|(Host\":)|\{|\}/g,"") thost=cnt.indexOf("sni=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("sni=")[1].split("&")[0].split("#")[0]).replace(/\"|(Host\":)|\{|\}/g,"") thost=cnt.indexOf("peer=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("peer=")[1].split("&")[0].split("#")[0]).replace(/\"|(Host\":)|\{|\}/g,"") @@ -2155,9 +2164,7 @@ function VL2QX(subs, Pudp, Ptfo, Pcert0, PTls13) { obfs = cnt.indexOf("security=tls") != -1 || cnt.indexOf("security=reality")!=-1? "obfs=wss" : "obfs=ws" } else if(cnt.indexOf("type=")==-1 || cnt.indexOf("type=tcp")!=-1) { obfs = "obfs=over-tls" - } else if(cnt.indexOf("security=xtls")!=-1) { //暂不支持类型 - type="NS" - } else if(cnt.indexOf("type=")!=-1 && cnt.indexOf("type=tcp")==-1) {//暂不支持类型 + } else if(cnt.indexOf("type=")!=-1 && cnt.indexOf("type=tcp")==-1) {//暂不支持类型 type="NS" } thost=cnt.indexOf("&host=") == -1? thost : "obfs-host=" + decodeURIComponent(cnt.split("&host=")[1].split("&")[0].split("#")[0]) @@ -2179,6 +2186,7 @@ if(obfs=="obfs=wss" && obfs=="obfs=over-tls"){ prlt= version>=891? Reality_Handle(cnt) : "" nvless.push(type + ip, pwd, mtd, obfs, pcert, thost, puri, pudp, ptfo, prlt, tag) QX = type!="NS"? nvless.filter(Boolean).join(", ") : "" + PNS= type=="NS"? PNS+1 : PNS return QX }