主理人序
JavaScript 介绍
JavaScript(通常缩写为JS)是一种高级的、解释型的编程语言。JavaScript是一门基于原型、头等函数的语言,是一门多范式的语言,它支持面向对象程序设计,指令式编程,以及函数式编程。它提供语法来操控文本、数组、日期以及正则表达式等,不支持I/O,比如网络、存储和图形等,但这些都可以由它的宿主环境提供支持。它已经由ECMA(欧洲电脑制造商协会)通过ECMAScript实现语言的标准化。它被世界上的绝大多数网站所使用,也被世界主流浏览器(Chrome、IE、Firefox、Safari、Opera)支持。 via 维基百科;
流媒体解锁检测原理
这就要说一说 HTTP 响应代码 、HTTP 请求方法了;我们知道,同样一个网页某些节点能访问(HTTP状态码为200),而其他节点不能(HTTP状态码为404或403),嗯。So,我想你应该已经可以GET到点子上来了。
前置步骤(下载 JavaScript 脚本)
nfcheck.js 内容
/***
Thanks to & modified from https://gist.githubusercontent.com/Hyseen/b06e911a41036ebc36acf04ddebe7b9a/raw/nf_check.js
For Quantumult-X / [task-local]
@XIAO_KOP
**/
const BASE_URL = 'https://www.netflix.com/title/'
const FILM_ID = 81215567
const link = { "media-url": "https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/img/southpark/7.png" }
const policy_name = "Netflix" //填入你的 netflix 策略组名
const arrow = "➟"
var output = ""
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" , "🇿🇦"]])
function ReadPolicy(cnt) {
var res = ""
for (var key in cnt) {
if (key == policy_name){
dd = cnt[key]
res = res + dd.join(arrow)
break
}
}
return res.split(policy_name+arrow)[1]
}
const message = {
action: "get_policy_state",
//content: dict
};
$configuration.sendMessage(message).then(resolve => {
if (resolve.error) {
console.log(resolve.error);
}
if (resolve.ret) {
output = ReadPolicy(resolve.ret)
}
})
!(async () => {
let result = {
title: 'Netflix 解锁检测',
subtitle: output,
content: '检测失败,请重试',
}
await test(FILM_ID)
.then((code) => {
console.log(code)
if (code === 'Not Available') {
result['content'] = '该节点未解锁 Netflix'
//console.log(result)
return
}
if (code === 'Not Found') {
result['content'] = '该节点仅支持解锁 Netflix 自制剧'
return
}
result['content'] = '该节点完整解锁 Netflix ➟ ⟦'+flags.get(code.toUpperCase())+" 地区⟧"
$notify(result["title"], output, result["content"], link)
//console.log(result)
$done()
})
})()
.finally(() => $.done());
function test(filmId) {
return new Promise((resolve, reject) => {
let option = {
url: BASE_URL + filmId,
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',
},
}
$task.fetch(option).then (response => {
console.log(response.statusCode)
if (response.statusCode === 404) {
resolve('Not Found')
return
}
if (response.statusCode === 403) {
resolve('Not Available')
return
}
if (response.statusCode === 200) {
let url = response.headers['X-Originating-URL']
let region = url.split('/')[3]
region = region.split('-')[0]
if (region == 'title') {
region = 'us'
}
resolve(region)
return
}
reject('Error')
})
})
}
nfcheck.js 需要修改部分说明
1.nfcheck.js 脚本内填入自己对应的策略组名(这里示例为 🎥 Netflix ),才能显示当前出口节点;
const policy_name = "Netflix" //填入你的 netflix 策略组名
如何更方便的执行检测脚本(捷径)
参阅 机场情报;
如何更方便的执行检测脚本(捷径-文件App-执行 nfcheck.js)
1.打开捷径(跳转至 文件 - );
2.运行 nfcheck.js;
制作捷径(快捷进入 nfcheck.js 所在目录)
1.进入捷径APP,我的快捷指令 - 所有快捷键指令;
2.点击右上角 + 按钮,
3.点击 添加操作,选 APP,找到 文件 App,选中;
4.它会弹出相应文件夹让你选择,选中 nfcheck.js 所在文件夹;
5.以上,命名好捷径名称即可;
如何更方便的执行检测脚本 - Quantumult task
Quantumult task - 自动化执行脚本使用说明
1.如上图,找到 工具&分析 - 构造HTTP请求,进入;
2.如上图,点击右上角 + 号,新建任务,选择 高级;
3.如上图,填入任务标签,自动执行时间间隔,脚本路径,任务图标(非必填);
以上。
That's All.
如需自动化定时执行 JavaScript 脚本,如每分钟或更长时间段自动执行一次解锁检测,可以参阅 JavaScript 脚本以及[task]使用;在此不再赘述;
如何更方便的执行检测脚本(捷径-自动化)
1.进入捷径APP,自动化;
2.点击右上角 + 按钮,
3.创建个人自动化,找到 App(打开或关闭App执行自动化操作),
4.搜索并选取 Netflix,
5.添加操作,搜索并选取 Quantumult X(执行脚本),
6.填写脚本路径
非官方吐槽
1、需要定时或手动运行 task,才会检测(挺鸡肋);
2、真不如用 safari 桌面网站做成重写触发的方式、或者其它widget;
via Shawn;
Netflix 解锁批量检测
via 机场情报;
附注
文章编写,修改源自 Quantumult X 非官方通知频道;
版权属于:毒奶
联系我们:https://limbopro.com/6.html
毒奶搜索:https://limbopro.com/search.html
机场推荐:https://limbopro.com/865.html IEPL专线/100Gb/¥15/月起
毒奶导航:https://limbopro.com/daohang/index.html本文链接:https://limbopro.com/archives/18926.html
本文采用 CC BY-NC-SA 4.0 许可协议,转载或引用本文时请遵守许可协议,注明出处、不得用于商业用途!