diff --git a/Scripts/switch-check-nf.js b/Scripts/switch-check-nf.js index d9cea24..870a086 100644 --- a/Scripts/switch-check-nf.js +++ b/Scripts/switch-check-nf.js @@ -32,6 +32,7 @@ var OKList=["完整解锁节点 ➟ "] var ResList=["仅支持自制剧节点 ➟ "] var NoList=["不支持节点 ➟ "] var timeoutList=["检测超时节点 ➟ "] +var pflag=1 //是否是策略,或者简单节点 $configuration.sendMessage(message).then(resolve => { if (resolve.error) { @@ -41,6 +42,9 @@ $configuration.sendMessage(message).then(resolve => { if (resolve.ret) { //$notify(JSON.stringify(resolve.ret)) output=JSON.stringify(resolve.ret[message.content])? JSON.stringify(resolve.ret[message.content]["candidates"]).replace(/\"|\[|\]/g,"").replace(/\,/g," ➟ ").split(" ➟ ") : [$environment.params] + pflag = JSON.stringify(resolve.ret[message.content])? pflag:0 + console.log("Netflix 支持检测") + console.log("节点or策略组:"+pflag) //$notify(typeof(output),output) Check() //$done({"title":"策略内容","message":output}) @@ -56,20 +60,27 @@ function Check() { for ( var i=0;i < output.length;i++) { testNF(output[i]) } - if (output.length<=5) { - relay = 2000 + if (output.length<=3) { + relay = 3500 + } else if (output.length<=5) { + relay = 4000 } else if (output.length<10) { - relay =4000 + relay =4500 } else if (output.length<15) { - relay =6000 + relay =6500 } else if (output.length<20) { - relay =8000 + relay =8500 + } else if (output.length<50){ + relay =11000 } else { - relay =10000 + relay =13000 } console.log(output.length+":"+relay) setTimeout(() => { - const dict = { [policy] : OKList[2]}; + const dict = { [policy] : OKList[1]}; + if(OKList[1]) { + console.log("选定支持节点:"+OKList[1]) + } const mes1 = { action: "set_policy_state", content: dict @@ -77,13 +88,15 @@ function Check() { $configuration.sendMessage(mes1).then(resolve => { if (resolve.error) { console.log(resolve.error); - content = `

` + "
⟦ "+$environment.params+ " ⟧ 切换失败
未找到完整支持 Netflix 的节点" + `

` - $done({"title":" Netflix 切换", "htmlMessage": content}) + content =pflag==0 && OKList[1]? `

` + "
⟦ "+$environment.params+ " ⟧

该节点完整支持 Netflix" + `

` : `

` + "
⟦ "+$environment.params+ " ⟧

该节点不支持 Netflix" + `

` + + content = pflag!=0 && !OKList[1]? `

` + "
⟦ "+$environment.params+ " ⟧ 切换失败

该策略组内未找到完整支持 Netflix 的节点" + "

-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`

` : content + $done({"title":"Netflix 检测&切换", "htmlMessage": content}) } if (resolve.ret) { - console.log("已经切换至完整支持的路线 ➟ "+OKList[2]) - content = `

` + "
⟦ "+$environment.params+ " ⟧ 已切换至完整支持的路线

👇

⟦ "+OKList[2]+ " ⟧" + "

-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`

` - $done({"title":" Netflix 切换", "htmlMessage": content }) + console.log("已经切换至完整支持的路线 ➟ "+OKList[1]) + content = `

` + "
⟦ "+$environment.params+ " ⟧ 已切换至完整支持的路线

👇

⟦ "+OKList[1]+ " ⟧" + "

-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`

` + $done({"title":"Netflix 检测&切换", "htmlMessage": content }) } }, reject => { $done(); diff --git a/Scripts/switch-check-ytb.js b/Scripts/switch-check-ytb.js index 75fd878..23be138 100644 --- a/Scripts/switch-check-ytb.js +++ b/Scripts/switch-check-ytb.js @@ -32,6 +32,7 @@ var output=[] var OKList=["支持节点 ➟ "] var NoList=["不支持节点 ➟ "] var ErrorList=["检测出错节点 ➟ "] +var pflag=1 //是否是策略,或者简单节点 $configuration.sendMessage(message).then(resolve => { if (resolve.error) { @@ -41,6 +42,9 @@ $configuration.sendMessage(message).then(resolve => { if (resolve.ret) { //$notify(JSON.stringify(resolve.ret)) output=JSON.stringify(resolve.ret[message.content])? JSON.stringify(resolve.ret[message.content]["candidates"]).replace(/\"|\[|\]/g,"").replace(/\,/g," ➟ ").split(" ➟ ") : [$environment.params] + pflag = JSON.stringify(resolve.ret[message.content])? pflag:0 + console.log("YouTube Premium 检测") + console.log("节点or策略组:"+pflag) //$notify(typeof(output),output) Check() //$done({"title":"策略内容","message":output}) @@ -69,7 +73,10 @@ function Check() { } console.log(output.length+":"+relay) setTimeout(() => { - const dict = { [policy] : OKList[2]}; + const dict = { [policy] : OKList[1]}; + if(OKList[1]) { + console.log("选定支持节点:"+OKList[1]) + } const mes1 = { action: "set_policy_state", content: dict @@ -77,13 +84,14 @@ function Check() { $configuration.sendMessage(mes1).then(resolve => { if (resolve.error) { console.log(resolve.error); - content = `

` + "
⟦ "+$environment.params+ " ⟧ 切换失败
未找到支持 YouTube Premium 的节点" + `

` - $done({"title":" YouTube 切换", "htmlMessage": content}) + content =pflag==0 && OKList[1]? `

` + "
⟦ "+$environment.params+ " ⟧

该节点支持 YouTube Premium" + `

` : `

` + "
⟦ "+$environment.params+ " ⟧

该节点不支持 YouTube Premium" + `

` + content = pflag!=0 && !OKList[1]? `

` + "
⟦ "+$environment.params+ " ⟧ 切换失败

该策略组内未找到支持 YouTube Premium 的节点" + "

-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`

` : content + $done({"title":"YouTube 检测&切换", "htmlMessage": content}) } if (resolve.ret) { - console.log("已经切换至支持 Premium 的路线 ➟ "+OKList[2]) - content = `

` + "
⟦ "+$environment.params+ " ⟧ 已切换至支持Premium 的路线

👇

⟦ "+OKList[2]+ " ⟧" + "

-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`

` - $done({"title":" YouTube 切换", "htmlMessage": content }) + console.log("已经切换至支持 Premium 的路线 ➟ "+OKList[1]) + content = `

` + "
⟦ "+$environment.params+ " ⟧ 已切换至支持Premium 的路线

👇

⟦ "+OKList[1]+ " ⟧" + "

-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`

` + $done({"title":"YouTube 检测&切换", "htmlMessage": content }) } }, reject => { $done();