This commit is contained in:
Shawn
2021-10-06 23:11:48 +08:00
parent 19550c8af3
commit da8b14096a
3 changed files with 33 additions and 20 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -1826,7 +1826,7 @@ function get_emoji(emojip, sname) {
"🇫🇮": ["Finland", "芬兰","芬蘭","赫尔辛基"],
"🇫🇷": ["FR", "France", "法国", "法國", "巴黎"],
"🇬🇧": ["UK", "GB", "England", "United Kingdom", "英国", "伦敦", "英"],
"🇲🇴": ["MO", "Macao", "MAC", "澳门", "澳門", "CTM"],
"🇲🇴": ["MO", "Macao","Macau", "MAC", "澳门", "澳門", "CTM"],
"🇰🇿": ["哈萨克斯坦"],
"🇭🇺": ["匈牙利", "Hungary"],
"🇱🇹": ["立陶宛"],

View File

@@ -1,8 +1,9 @@
/***
Thanks to & modified from
1https://gist.githubusercontent.com/Hyseen/b06e911a41036ebc36acf04ddebe7b9a/raw/nf_check.js
2https://github.com/AtlantisGawrGura/Quantumult-X-Scripts/blob/main/media.js
1. https://gist.githubusercontent.com/Hyseen/b06e911a41036ebc36acf04ddebe7b9a/raw/nf_check.js
2. https://github.com/AtlantisGawrGura/Quantumult-X-Scripts/blob/main/media.js
3. https://github.com/CoiaPrant/MediaUnlock_Test/blob/main/check.sh
For Quantumult-X 598+
@@ -20,7 +21,7 @@ event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/
const BASE_URL = 'https://www.netflix.com/title/';
const BASE_URL_YTB = "https://www.youtube.com/premium";
const BASE_URL_DISNEY = 'https://www.disneyplus.com';
const BASE_URL_Dazn = "https://www.dazn.com/";
const BASE_URL_Dazn = "https://startup.core.indazn.com/misl/v5/Startup";
//var BASE_URL_BLBL = "https://api.bilibili.com/pgc/player/web/playurl?avid=18281381&cid=29892777&qn=0&type=&otype=json&ep_id=183799&fourk=1&fnver=0&fnval=16&session=" + randomString(20) + "&module=bangumi";
//const BASE_URL_BahamutAnime = 'https://ani.gamer.com.tw/ajax/token.php?adID=89422&sn=14667';
//const BASE_URL_HULUJP = 'https://id.hulu.jp';
@@ -59,10 +60,10 @@ function randomString(e)
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" , "🇿🇦"]])
let result = {
"title": '📺 流媒体服务查询\n----------------------',
"title": '📺 流媒体服务查询',
"YouTube": 'YouTube: 检测失败,请重试',
"Netflix": 'Netflix: 检测失败,请重试',
//"Dazn": "Dazn: 检测失败,请重试",
"Dazn": "Dazn: 检测失败,请重试",
"Disney": "Disney: 检测失败,请重试",
//"Google": "Google 定位: 检测失败,请重试"
@@ -74,9 +75,9 @@ function StreamingCheck(){
testYTB()
test(FILM_ID)
testDisney()
//testDazn()
testDazn()
setTimeout(function(){
$done({"title": result["title"],"message": ([result["YouTube"],result["Netflix"],result["Disney"]]).join("\n\n") +'\n----------------------\n'+ $environment.params})
$done({"title": result["title"],"message": "\n----------------------"+([result["YouTube"],result["Netflix"],result["Disney"],result["Dazn"]]).join("\n\n") +'\n----------------------\n'+ $environment.params})
},6000)
}
@@ -203,40 +204,52 @@ function testDisney(){
}
function testDazn() {
const extra =`{
"LandingPageKey":"generic",
"Platform":"web",
"PlatformAttributes":{},
"Manufacturer":"",
"PromoCode":"",
"Version":"2"
}`
let option = {
url: BASE_URL_Dazn,
method: "POST",
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'
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36',
"Content-Type": "application/json"
},
body: extra
}
$task.fetch(option).then(response=> {
let data = response.body
//data = extra
let header = JSON.stringify(response.headers)
console.log("Dazn:"+response.statusCode)
console.log("Dazn:"+header)
//console.log("Dazn:"+data)
//$done(data)
if (response.statusCode !== 200) {
//reject('Error')
result["Dazn"] = "Dazn: 检测失败"
} else if (data.indexOf('Premium is not available in your country') !== -1) {
//resolve('Not Available')
result["Dazn"] = "Dazn: 未支持"
} else if (data.indexOf('Premium is not available in your country') == -1) {//console.log(data.split("countryCode")[1])
} else if (response.statusCode == 200) {//console.log(data.split("countryCode")[1])
console.log(data)
let region = ''
let re = new RegExp('"GL":"(.*?)"', 'gm')
let re = new RegExp('"GeolocatedCountry":"(.*?)"', 'gm')
let ret = re.exec(data)
if (ret != null && ret.length === 2) {
region = ret[1]
} else if (data.indexOf('www.google.cn') !== -1) {
region = 'CN'
result["Dazn"] = "Dazn: 支持"+ "⟦"+flags.get(region.toUpperCase())+"⟧"
} else {
region = 'US'
result["Dazn"] = "Dazn: 未支持"
}
//resolve(region)
result["Dazn"] = "Dazn: 支持"+ "⟦"+flags.get(region.toUpperCase())+"⟧"
console.log("Dazn:"+region+ result["Dazn"])
console.log("Dazn:"+region+ result["Dazn"])
}
}, reason => {
result["Dazn"] = "Dazn: 检测超时"