diff --git a/Scripts/geo_location.js b/Scripts/geo_location.js index 1645cca..40317c1 100644 --- a/Scripts/geo_location.js +++ b/Scripts/geo_location.js @@ -1,7 +1,4 @@ /*** - - For Quantumult-X 598+ - [task_local] event-interaction geo_location.js, tag=GeoIP 查询, img-url=location.fill.viewfinder.system @@ -15,19 +12,21 @@ }; var myRequest = { url: url, - opts: opts + opts: opts, + timeout: 4000 }; var message = "" const paras = ["ip","isp","country_code","city"] const paran = ["IP","ISP","地区","城市"] $task.fetch(myRequest).then(response => { - message = json2info(response.body,paras) + message = response? json2info(response.body,paras) : "" $done({"title":"🔎 IP.SB 查询结果","message":message}); }, reason => { - message.appennd("🛑 查询失败") - $done({"title": "The Error Title", "message": message}); - }); + message = "\n\n🛑 查询超时" + $done({"title": "🔎 IP.SB 查询结果", "message": message}); + }) + function json2info(cnt,paras) { var res = "----------------------\n" @@ -40,4 +39,5 @@ function json2info(cnt,paras) { return res } + var flags = new Map([[ "AC" , "🇦🇨" ] , [ "AF" , "🇦🇫" ] , [ "AI" , "🇦🇮" ] , [ "AL" , "🇦🇱" ] , [ "AM" , "🇦🇲" ] , [ "AQ" , "🇦🇶" ] , [ "AR" , "🇦🇷" ] , [ "AS" , "🇦🇸" ] , [ "AT" , "🇦🇹" ] , [ "AU" , "🇦🇺" ] , [ "AW" , "🇦🇼" ] , [ "AX" , "🇦🇽" ] , [ "AZ" , "🇦🇿" ] , [ "BB" , "🇧🇧" ] , [ "BD" , "🇧🇩" ] , [ "BE" , "🇧🇪" ] , [ "BF" , "🇧🇫" ] , [ "BG" , "🇧🇬" ] , [ "BH" , "🇧🇭" ] , [ "BI" , "🇧🇮" ] , [ "BJ" , "🇧🇯" ] , [ "BM" , "🇧🇲" ] , [ "BN" , "🇧🇳" ] , [ "BO" , "🇧🇴" ] , [ "BR" , "🇧🇷" ] , [ "BS" , "🇧🇸" ] , [ "BT" , "🇧🇹" ] , [ "BV" , "🇧🇻" ] , [ "BW" , "🇧🇼" ] , [ "BY" , "🇧🇾" ] , [ "BZ" , "🇧🇿" ] , [ "CA" , "🇨🇦" ] , [ "CF" , "🇨🇫" ] , [ "CH" , "🇨🇭" ] , [ "CK" , "🇨🇰" ] , [ "CL" , "🇨🇱" ] , [ "CM" , "🇨🇲" ] , [ "CN" , "🇨🇳" ] , [ "CO" , "🇨🇴" ] , [ "CP" , "🇨🇵" ] , [ "CR" , "🇨🇷" ] , [ "CU" , "🇨🇺" ] , [ "CV" , "🇨🇻" ] , [ "CW" , "🇨🇼" ] , [ "CX" , "🇨🇽" ] , [ "CY" , "🇨🇾" ] , [ "CZ" , "🇨🇿" ] , [ "DE" , "🇩🇪" ] , [ "DG" , "🇩🇬" ] , [ "DJ" , "🇩🇯" ] , [ "DK" , "🇩🇰" ] , [ "DM" , "🇩🇲" ] , [ "DO" , "🇩🇴" ] , [ "DZ" , "🇩🇿" ] , [ "EA" , "🇪🇦" ] , [ "EC" , "🇪🇨" ] , [ "EE" , "🇪🇪" ] , [ "EG" , "🇪🇬" ] , [ "EH" , "🇪🇭" ] , [ "ER" , "🇪🇷" ] , [ "ES" , "🇪🇸" ] , [ "ET" , "🇪🇹" ] , [ "EU" , "🇪🇺" ] , [ "FI" , "🇫🇮" ] , [ "FJ" , "🇫🇯" ] , [ "FK" , "🇫🇰" ] , [ "FM" , "🇫🇲" ] , [ "FO" , "🇫🇴" ] , [ "FR" , "🇫🇷" ] , [ "GA" , "🇬🇦" ] , [ "GB" , "🇬🇧" ] , [ "HK" , "🇭🇰" ] ,["HU","🇭🇺"], [ "ID" , "🇮🇩" ] , [ "IE" , "🇮🇪" ] , [ "IL" , "🇮🇱" ] , [ "IM" , "🇮🇲" ] , [ "IN" , "🇮🇳" ] , [ "IS" , "🇮🇸" ] , [ "IT" , "🇮🇹" ] , [ "JP" , "🇯🇵" ] , [ "KR" , "🇰🇷" ] , [ "LU" , "🇱🇺" ] , [ "MO" , "🇲🇴" ] , [ "MX" , "🇲🇽" ] , [ "MY" , "🇲🇾" ] , [ "NL" , "🇳🇱" ] , [ "PH" , "🇵🇭" ] , [ "RO" , "🇷🇴" ] , [ "RS" , "🇷🇸" ] , [ "RU" , "🇷🇺" ] , [ "RW" , "🇷🇼" ] , [ "SA" , "🇸🇦" ] , [ "SB" , "🇸🇧" ] , [ "SC" , "🇸🇨" ] , [ "SD" , "🇸🇩" ] , [ "SE" , "🇸🇪" ] , [ "SG" , "🇸🇬" ] , [ "TH" , "🇹🇭" ] , [ "TN" , "🇹🇳" ] , [ "TO" , "🇹🇴" ] , [ "TR" , "🇹🇷" ] , [ "TV" , "🇹🇻" ] , [ "TW" , "🇨🇳" ] , [ "UK" , "🇬🇧" ] , [ "UM" , "🇺🇲" ] , [ "US" , "🇺🇸" ] , [ "UY" , "🇺🇾" ] , [ "UZ" , "🇺🇿" ] , [ "VA" , "🇻🇦" ] , [ "VE" , "🇻🇪" ] , [ "VG" , "🇻🇬" ] , [ "VI" , "🇻🇮" ] , [ "VN" , "🇻🇳" ] , [ "ZA" , "🇿🇦"]]) diff --git a/Scripts/nf-ui-check.js b/Scripts/nf-ui-check.js index b15eb2e..281eb80 100644 --- a/Scripts/nf-ui-check.js +++ b/Scripts/nf-ui-check.js @@ -33,23 +33,23 @@ var flags = new Map([[ "AC" , "🇦🇨" ] , [ "AF" , "🇦🇫" ] , [ "AI" , " let result = { title: 'Netflix 解锁检测', subtitle: output, - content: '----------------------\n\n检测失败,请重试', + content: '检测失败,请重试', } await Promise.race([test(FILM_ID),timeOut(5000)]) .then((code) => { console.log(code) if (code === 'Not Available') { - result['content'] = '----------------------\n\n该节点未支持 Netflix' + result['content'] = '该节点未解锁 Netflix' //return //console.log(result) } else if (code === 'Not Found') { - result['content'] = '----------------------\n\n该节点仅支持 Netflix 自制剧' + result['content'] = '该节点仅支持解锁 Netflix 自制剧' //return } else if (code === "timeout") { - result['content'] = "----------------------\n\n测试超时" + result['content'] = "测试超时" } else { - result['content'] = '----------------------\n\n该节点完整支持 Netflix ➟ ⟦'+flags.get(code.toUpperCase())+code.toUpperCase()+"⟧" + result['content'] = '该节点完整解锁 Netflix ➟ ⟦'+flags.get(code.toUpperCase())+" 地区⟧" } //$notify(result["title"], output, result["content"], link) diff --git a/Scripts/nf_ytb_ui-check.js b/Scripts/nf_ytb_ui-check.js index 45fa0e9..7db0e9d 100644 --- a/Scripts/nf_ytb_ui-check.js +++ b/Scripts/nf_ytb_ui-check.js @@ -51,7 +51,7 @@ var flags = new Map([[ "AC" , "🇦🇨" ] , [ "AF" , "🇦🇫" ] , [ "AI" , " result['content'] = '----------------------\n\n⚠️ 仅支持 Netflix 自制剧' //return } else if (code === "timeout") { - result['content'] = "----------------------\n\n测试超时" + result['content'] = "----------------------\n\n🛑 测试超时" } else { result['content'] = '----------------------\n\n✅ 完整支持 Netflix ➟ ⟦'+flags.get(code.toUpperCase())+code.toUpperCase()+"⟧" } @@ -93,6 +93,7 @@ function test(filmId) { let option = { url: BASE_URL + filmId, opts: opts, + timeout: 4000, headers: { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36', @@ -121,7 +122,11 @@ function test(filmId) { return } reject('Error') - }) + }, reason => { + resolve("timeout") + return + } + ) }) } @@ -130,6 +135,7 @@ function testYTB() { let option = { url: BASE_URL_YTB, opts: opts, + timeout: 4000, headers: { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36' @@ -159,6 +165,8 @@ function testYTB() { region = 'US' } resolve(region) + }, reason => { + resolve("timeout") }) }) }