├── HotKids-JS
├── scripts.conf
└── .DS_Store
├── .DS_Store
├── img
├── .DS_Store
├── sub
│ └── Dler.png
├── others
│ └── lee.png
├── policy
│ ├── as.PNG
│ ├── cn.PNG
│ ├── cn0.PNG
│ ├── eu.PNG
│ ├── hk.PNG
│ ├── jp.PNG
│ ├── mine.PNG
│ ├── mo.PNG
│ ├── us.png
│ ├── ytb.png
│ ├── apple.png
│ ├── final.png
│ ├── proxy.png
│ ├── downloads.png
│ ├── netflix.png
│ ├── telegram.png
│ └── youtube.png
├── southpark
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ ├── 7.png
│ ├── 8.png
│ ├── 9.png
│ ├── 10.png
│ └── .DS_Store
└── dragonball
│ ├── 1.PNG
│ ├── 10.PNG
│ ├── 11.PNG
│ ├── 12.PNG
│ ├── 13.PNG
│ ├── 14.PNG
│ ├── 15.PNG
│ ├── 16.PNG
│ ├── 17.PNG
│ ├── 18.PNG
│ ├── 19.PNG
│ ├── 2.PNG
│ ├── 20.PNG
│ ├── 21.PNG
│ ├── 22.PNG
│ ├── 23.PNG
│ ├── 24.PNG
│ ├── 25.PNG
│ ├── 26.PNG
│ ├── 27.PNG
│ ├── 28.PNG
│ ├── 29.PNG
│ ├── 3.PNG
│ ├── 30.PNG
│ ├── 31.PNG
│ ├── 32.PNG
│ ├── 33.PNG
│ ├── 34.PNG
│ ├── 4.PNG
│ ├── 7.PNG
│ ├── 8.PNG
│ └── 9.PNG
├── Scripts
├── .DS_Store
├── IPCustom.js
├── Cron-Switch.json
├── UI-Action.json
├── IPCheck.js
├── IPInfo.js
├── IPConfig.js
├── geo_location.js
├── IP_bili_cn.js
├── IP_bili.js
├── IP_API.js
├── ytb-ui-check.js
├── ytbcheck.js
├── nfcheck.js
├── nf-ui-check.js
├── emoji.json
├── traffic-check.js
├── nf_ytb_ui-check.js
├── TaskGallery.json
├── switch-check-ytb.js
├── disney-ui-check.js
├── switch-check-google.js
├── switch-check-nf.js
├── switch-check-disneyplus.js
└── streaming-ui-check.js
├── TikTok_Rewrite.list
├── README.md
├── Q-Search.list
├── remote-resource.json
├── QuanX-RuleSet-Divine-Engine.json
└── QuantumultX_Profiles.conf
/HotKids-JS/scripts.conf:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/.DS_Store
--------------------------------------------------------------------------------
/img/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/.DS_Store
--------------------------------------------------------------------------------
/img/sub/Dler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/sub/Dler.png
--------------------------------------------------------------------------------
/Scripts/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/Scripts/.DS_Store
--------------------------------------------------------------------------------
/img/others/lee.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/others/lee.png
--------------------------------------------------------------------------------
/img/policy/as.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/as.PNG
--------------------------------------------------------------------------------
/img/policy/cn.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/cn.PNG
--------------------------------------------------------------------------------
/img/policy/cn0.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/cn0.PNG
--------------------------------------------------------------------------------
/img/policy/eu.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/eu.PNG
--------------------------------------------------------------------------------
/img/policy/hk.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/hk.PNG
--------------------------------------------------------------------------------
/img/policy/jp.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/jp.PNG
--------------------------------------------------------------------------------
/img/policy/mine.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/mine.PNG
--------------------------------------------------------------------------------
/img/policy/mo.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/mo.PNG
--------------------------------------------------------------------------------
/img/policy/us.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/us.png
--------------------------------------------------------------------------------
/img/policy/ytb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/ytb.png
--------------------------------------------------------------------------------
/img/southpark/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/southpark/1.png
--------------------------------------------------------------------------------
/img/southpark/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/southpark/2.png
--------------------------------------------------------------------------------
/img/southpark/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/southpark/3.png
--------------------------------------------------------------------------------
/img/southpark/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/southpark/4.png
--------------------------------------------------------------------------------
/img/southpark/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/southpark/5.png
--------------------------------------------------------------------------------
/img/southpark/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/southpark/6.png
--------------------------------------------------------------------------------
/img/southpark/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/southpark/7.png
--------------------------------------------------------------------------------
/img/southpark/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/southpark/8.png
--------------------------------------------------------------------------------
/img/southpark/9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/southpark/9.png
--------------------------------------------------------------------------------
/HotKids-JS/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/HotKids-JS/.DS_Store
--------------------------------------------------------------------------------
/img/dragonball/1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/1.PNG
--------------------------------------------------------------------------------
/img/dragonball/10.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/10.PNG
--------------------------------------------------------------------------------
/img/dragonball/11.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/11.PNG
--------------------------------------------------------------------------------
/img/dragonball/12.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/12.PNG
--------------------------------------------------------------------------------
/img/dragonball/13.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/13.PNG
--------------------------------------------------------------------------------
/img/dragonball/14.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/14.PNG
--------------------------------------------------------------------------------
/img/dragonball/15.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/15.PNG
--------------------------------------------------------------------------------
/img/dragonball/16.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/16.PNG
--------------------------------------------------------------------------------
/img/dragonball/17.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/17.PNG
--------------------------------------------------------------------------------
/img/dragonball/18.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/18.PNG
--------------------------------------------------------------------------------
/img/dragonball/19.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/19.PNG
--------------------------------------------------------------------------------
/img/dragonball/2.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/2.PNG
--------------------------------------------------------------------------------
/img/dragonball/20.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/20.PNG
--------------------------------------------------------------------------------
/img/dragonball/21.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/21.PNG
--------------------------------------------------------------------------------
/img/dragonball/22.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/22.PNG
--------------------------------------------------------------------------------
/img/dragonball/23.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/23.PNG
--------------------------------------------------------------------------------
/img/dragonball/24.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/24.PNG
--------------------------------------------------------------------------------
/img/dragonball/25.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/25.PNG
--------------------------------------------------------------------------------
/img/dragonball/26.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/26.PNG
--------------------------------------------------------------------------------
/img/dragonball/27.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/27.PNG
--------------------------------------------------------------------------------
/img/dragonball/28.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/28.PNG
--------------------------------------------------------------------------------
/img/dragonball/29.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/29.PNG
--------------------------------------------------------------------------------
/img/dragonball/3.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/3.PNG
--------------------------------------------------------------------------------
/img/dragonball/30.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/30.PNG
--------------------------------------------------------------------------------
/img/dragonball/31.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/31.PNG
--------------------------------------------------------------------------------
/img/dragonball/32.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/32.PNG
--------------------------------------------------------------------------------
/img/dragonball/33.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/33.PNG
--------------------------------------------------------------------------------
/img/dragonball/34.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/34.PNG
--------------------------------------------------------------------------------
/img/dragonball/4.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/4.PNG
--------------------------------------------------------------------------------
/img/dragonball/7.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/7.PNG
--------------------------------------------------------------------------------
/img/dragonball/8.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/8.PNG
--------------------------------------------------------------------------------
/img/dragonball/9.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/dragonball/9.PNG
--------------------------------------------------------------------------------
/img/policy/apple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/apple.png
--------------------------------------------------------------------------------
/img/policy/final.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/final.png
--------------------------------------------------------------------------------
/img/policy/proxy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/proxy.png
--------------------------------------------------------------------------------
/img/southpark/10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/southpark/10.png
--------------------------------------------------------------------------------
/img/policy/downloads.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/downloads.png
--------------------------------------------------------------------------------
/img/policy/netflix.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/netflix.png
--------------------------------------------------------------------------------
/img/policy/telegram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/telegram.png
--------------------------------------------------------------------------------
/img/policy/youtube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/policy/youtube.png
--------------------------------------------------------------------------------
/img/southpark/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fyjsy/KOP-XIAO/HEAD/img/southpark/.DS_Store
--------------------------------------------------------------------------------
/TikTok_Rewrite.list:
--------------------------------------------------------------------------------
1 | hostname = *.musical.ly, *.tiktokv.com,*.tiktokcdn.com, api*.amemv.com, aweme*.snssdk.com
2 |
3 | (.*video_id=\w{32})(.*watermark=)(.*) url 302 $1
4 | (?<=(carrier|account|sys)_region=)CN url 307 JP
5 | (?<=version_code=)\d{1,}.\d{1}\.\d{1} url 307 8.4.0
6 | ;(如果想解锁美区tiktok将此条注释)
7 |
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # QuantumultX
2 | > 纯自用,无规则,无维护,无更新
3 |
4 | 仅以下项目可能会更新维护:
5 |
6 | 1⃣️ Quantumult X 资源解析器:
7 |
8 |
9 | https://github.com/KOP-XIAO/QuantumultX/blob/master/Scripts/resource-parser.js
10 |
11 |
12 |
13 | 有bug请反馈 [@Shawn_Parser_Bot](https://t.me/Shawn_Parser_Bot)
14 |
15 | 更新请关注 tg 频道 https://t.me/QuanX_API
16 |
17 |
18 |
19 | 觉得有帮助可以请喝咖啡:
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Q-Search.list:
--------------------------------------------------------------------------------
1 | #From 🐩️哥 (https://raw.githubusercontent.com/Neurogram-R/Surge/master/module/Q-Search.sgmodule)
2 | #- Safari 内输入 命令 + 空格 + 关键词 快速指定搜索引擎搜索
3 | #注:先进入设置更改 Safari 默认搜索为 DuckDuckGO
4 |
5 | hostname = duckduckgo.com
6 |
7 |
8 | ^https:\/\/duckduckgo.com\/\?q=db\+([^&]+).+ url 302 https://m.douban.com/search/?query=$1
9 | ^https:\/\/duckduckgo.com\/\?q=ddg\+([^&]+).+ url 302 https://duckduckgo.com/?ia=about&q=$1
10 | ^https:\/\/duckduckgo.com\/\?q=bd\+([^&]+).+ url 302 https://www.baidu.com/s?wd=$1
11 | ^https:\/\/duckduckgo.com\/\?q=gh\+([^&]+).+ url 302 https://github.com/search?q=$1
12 | ^https:\/\/duckduckgo.com\/\?q=gm\+([^&]+).+ url 302 https://www.google.com/search?&tbm=isch&q=$1
13 | ^https:\/\/duckduckgo.com\/\?q=yd\+([^&]+).+ url 302 https://dict.youdao.com/search?q=$1
14 | ^https:\/\/duckduckgo.com\/\?q=([^&]+).+ url 302 https://www.google.com/search?q=$1
15 |
--------------------------------------------------------------------------------
/Scripts/IPCustom.js:
--------------------------------------------------------------------------------
1 | // if ($response.statusCode != 200) {
2 | // $done(Null);
3 | // }
4 |
5 | // var body = $response.body;
6 | // var obj = JSON.parse(body);
7 |
8 | if ($response.statusCode != 200) {
9 | $done(Null);
10 | }
11 |
12 | function getRandomInt(max) {
13 | return Math.floor(Math.random() * Math.floor(max));
14 | }
15 |
16 | const foods = ['🍺','🍩','🍭','🦴','🥮','🍎', '🍐', '🍊', '🍋', '🍌', '🍉', '🍇', '🍓', '🍈', '🍒', '🍑', '🥭', '🍅', '🥑']
17 | const emojis= ['🆘','🈲','⚠️','🔞','📵','🚦','🏖','🖥','📺','🐧','🐬','🦉','🍄','⛳️','🚴','🤑','👽','🤖','🎃', '👺', '👁', '🐶', '🐼','🐌', '👥']
18 |
19 | var body = $response.body;
20 | var obj = JSON.parse(body);
21 | var title = emojis[getRandomInt(emojis.length)] +obj['country']+ '-' +obj['city']+ foods[getRandomInt(foods.length)];
22 | var subtitle =''+ obj['isp']+ '('+obj['ipType']+')';
23 | var ip = obj['query'];
24 | var description = obj['country'] + '-' + obj['city'] + '\n' + obj['isp'] + '\n' + obj['ipType']+ '\n' + ip;
25 |
26 | $done({title, subtitle, ip, description});
27 |
--------------------------------------------------------------------------------
/Scripts/Cron-Switch.json:
--------------------------------------------------------------------------------
1 | {
2 | "name":"流媒体定时切换合集 @Shawn",
3 | "description":"Crontab Script Gallery by Shawn",
4 | "task":[
5 | "0 8 * * * https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-ytb.js, tag=YouTube 定时切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/YouTube_Letter.png, enabled=true",
6 | "1 8 * * * https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-nf.js, tag=Netflix 定时切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Netflix_Letter.png, enabled=true",
7 | "2 8 * * * https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-disneyplus.js, tag=Disneyᐩ 定时切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Disney.png, enabled=true",
8 | "3 8 * * * https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-google.js, tag=Google 送中定时切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Google.png, enabled=true",
9 | ]
10 | }
--------------------------------------------------------------------------------
/remote-resource.json:
--------------------------------------------------------------------------------
1 | {
2 | "server_remote": [
3 | "https://raw.githubusercontent.com/crossutility/Quantumult-X/master/server.txt, tag=Sample-01",
4 | "https://raw.githubusercontent.com/crossutility/Quantumult-X/master/server-complete.txt, tag=Sample-02"
5 | ],
6 | "filter_remote": [
7 | "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Quantumult/X/Filter/Advertising.list, tag=去广告, enabled=true",
8 | "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Quantumult/X/Filter/Apple.list, tag=Apple服务, enabled=true",
9 | "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Quantumult/X/Filter/China.list, tag=国内网站, enabled=true",
10 | "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Quantumult/X/Filter/DomesticMedia.list, tag=国内视频, enabled=true",
11 | "http://cloudcompute.lbyczf.com/x-rule-set?url=https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Media/Netflix.list, tag=📺Netflix, force-policy=📺 Netflix, enabled=true",
12 | "http://cloudcompute.lbyczf.com/x-rule-set?url=https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Media/Youtube.list, tag=🎬Youtube, force-policy=🎬 Youtube, enabled=true",
13 | "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Quantumult/X/Filter/ForeignMedia.list, tag=国外视频, enabled=true",
14 | "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Quantumult/X/Filter/Global.list, tag=国外网站, enabled=true",
15 | "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Quantumult/X/Filter/Hijacking.list, tag=运营商劫持, enabled=true"
16 | ],
17 | "rewrite_remote": [
18 | " http://cloudcompute.lbyczf.com/quanx-rewrite, tag=Lhie1复写"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/QuanX-RuleSet-Divine-Engine.json:
--------------------------------------------------------------------------------
1 | {
2 | "list": [
3 | {
4 | "enable": true,
5 | "url": "https://gist.githubusercontent.com/Fndroid/58106962a852aa5c45bd1803b34b8651/raw/aa4649d63190a909a22e1c44fc23bfda382809dc/LAN.list",
6 | "note": "LAN",
7 | "policy": "DIRECT"
8 | },
9 | {
10 | "enable": true,
11 | "url": "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Apple.list",
12 | "note": "苹果",
13 | "policy": "Apple"
14 | },
15 | {
16 | "enable": true,
17 | "url": "https://gist.githubusercontent.com/Fndroid/58106962a852aa5c45bd1803b34b8651/raw/97d927bf19d7b61a7da0c8b305728f958f22b0eb/SYSTEM.list",
18 | "note": "SYSTEM",
19 | "policy": "DIRECT"
20 | },
21 | {
22 | "enable": true,
23 | "url": "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Advertising.list",
24 | "note": "黑名单",
25 | "policy": "REJECT"
26 | },
27 | {
28 | "enable": true,
29 | "url": "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Hijacking.list",
30 | "note": "运营商劫持",
31 | "policy": "REJECT"
32 | },
33 | {
34 | "enable": true,
35 | "url": "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Global.list",
36 | "note": "代理",
37 | "policy": "PROXY"
38 | },
39 | {
40 | "enable": true,
41 | "url": "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Telegram.list",
42 | "note": "Telegram",
43 | "policy": "PROXY"
44 | },
45 | {
46 | "enable": true,
47 | "url": "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/ForeignMedia.list",
48 | "note": "国外媒体",
49 | "policy": "PROXY"
50 | },
51 | {
52 | "enable": true,
53 | "url": "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/China.list",
54 | "note": "国内",
55 | "policy": "DIRECT"
56 | },
57 | {
58 | "enable": true,
59 | "url": "https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/DomesticMedia.list",
60 | "note": "国内媒体",
61 | "policy": "DIRECT"
62 | }
63 | ]
64 | }
65 |
--------------------------------------------------------------------------------
/Scripts/UI-Action.json:
--------------------------------------------------------------------------------
1 | {
2 | "name":"UI 脚本合集",
3 | "description":"UI-Interaction Script Gallery by Shawn",
4 | "task":[
5 | "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/streaming-ui-check.js, tag=流媒体-解锁查询, img-url=checkmark.seal.system, enabled=true",
6 | "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/geo_location.js, tag=GeoIP 查询, img-url=location.fill.viewfinder.system",
7 | "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/ytb-ui-check.js, tag=YouTube 查询, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/YouTube_Letter.png, enabled=true",
8 | "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/nf-ui-check.js, tag=Netflix 查询, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Netflix_Letter.png, enabled=true",
9 | "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/disney-ui-check.js, tag=Disneyᐩ 查询, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Disney.png, enabled=true",
10 | "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-ytb.js, tag=YouTube 切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/YouTube_Letter.png, enabled=true",
11 | "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-nf.js, tag=Netflix 切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Netflix_Letter.png, enabled=true",
12 | "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-disneyplus.js, tag=Disneyᐩ 切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Disney.png, enabled=true",
13 | "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-google.js, tag=Google 切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Google.png, enabled=true",
14 | "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/traffic-check.js, tag=策略流量查询, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Download.png, enabled=true"
15 | ]
16 | }
--------------------------------------------------------------------------------
/Scripts/IPCheck.js:
--------------------------------------------------------------------------------
1 |
2 | // if ($response.statusCode != 200) {
3 | // $done(Null);
4 | // }
5 | const emojis= ['🆘','🈲','⚠️','🔞','📵','🚦','🏖','🖥','📺','🐧','🐬','🦉','🍄','⛳️','🚴','🤑','👽','🤖','🎃', '👺', '👁', '🐶', '🐼','🐌', '👥']
6 |
7 | function getRandomInt(max) {
8 | return Math.floor(Math.random() * Math.floor(max));
9 | }
10 |
11 | function ValidCheck(para) {
12 | if(para) {
13 | return para
14 | } else
15 | {
16 | return emojis[getRandomInt(emojis.length)]
17 | }
18 | }
19 |
20 | var flags = new Map([[ "AC" , "🇦🇨" ] ,["AE","🇦🇪"], [ "AF" , "🇦🇫" ] , [ "AI" , "🇦🇮" ] , [ "AL" , "🇦🇱" ] , [ "AM" , "🇦🇲" ] , [ "AQ" , "🇦🇶" ] , [ "AR" , "🇦🇷" ] , [ "AS" , "🇦🇸" ] , [ "AT" , "🇦🇹" ] , [ "AU" , "🇦🇺" ] , [ "AW" , "🇦🇼" ] , [ "AX" , "🇦🇽" ] , [ "AZ" , "🇦🇿" ] , ["BA", "🇧🇦"], [ "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" , "🇿🇦"]])
21 | var body = $response.body;
22 | var obj = JSON.parse(body);
23 | var title = flags.get(obj['countryCode']) + ' '+ obj['country'];
24 | var subtitle =''+ValidCheck(obj['city'])+'-'+'('+obj['org']+')'+'';
25 | var ip = obj['query'];
26 | var description = obj['country'] + '-' +ValidCheck(obj['city']) + '\n' + obj['org'] + '\n'+obj['ipName']+ '\n' + obj['query'];
27 |
28 | $done({title, subtitle, ip, description});
29 |
--------------------------------------------------------------------------------
/Scripts/IPInfo.js:
--------------------------------------------------------------------------------
1 | // if ($response.statusCode != 200) {
2 | // $done(Null);
3 | // }
4 |
5 | const emojis= ['🆘','🈲','⚠️','🔞','📵','🚦','🏖','🖥','📺','🐧','🐬','🦉','🍄','⛳️','🚴','🤑','👽','🤖','🎃', '👺', '👁', '🐶', '🐼','🐌', '👥']
6 |
7 | function getRandomInt(max) {
8 | return Math.floor(Math.random() * Math.floor(max));
9 | }
10 |
11 | function ValidCheck(para) {
12 | if(para) {
13 | return para
14 | } else
15 | {
16 | return emojis[getRandomInt(emojis.length)]
17 | }
18 | }
19 |
20 | var flags = new Map([[ "AC" , "🇦🇨" ] ,["AE","🇦🇪"], [ "AF" , "🇦🇫" ] , [ "AI" , "🇦🇮" ] , [ "AL" , "🇦🇱" ] , [ "AM" , "🇦🇲" ] , [ "AQ" , "🇦🇶" ] , [ "AR" , "🇦🇷" ] , [ "AS" , "🇦🇸" ] , [ "AT" , "🇦🇹" ] , [ "AU" , "🇦🇺" ] , [ "AW" , "🇦🇼" ] , [ "AX" , "🇦🇽" ] , [ "AZ" , "🇦🇿" ] , ["BA", "🇧🇦"], [ "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" , "🇿🇦"]])
21 | var body = $response.body;
22 | //$notify("TEST","test",body);
23 | //var bd=body.split('\n')[1];
24 | var obj = JSON.parse(body);
25 | var title =flags.get(obj['country_code']) + ' '+ obj['country_name'];
26 | var subtitle =''+ValidCheck(obj['city'])+'-'+'('+ValidCheck(obj['continent_name'])+')'+'';
27 | var ip = obj['ip'];
28 | var description = obj['country_name'] + '-' +ValidCheck(obj['city']) + '\n' + obj['type'] + '\n' + obj['ip'];
29 | $done({title, subtitle, ip, description});
30 |
--------------------------------------------------------------------------------
/Scripts/IPConfig.js:
--------------------------------------------------------------------------------
1 | // if ($response.statusCode != 200) {
2 | // $done(Null);
3 | // }
4 |
5 | // var body = $response.body;
6 | // var obj = JSON.parse(body);
7 |
8 | if ($response.statusCode != 200) {
9 | $done(Null);
10 | }
11 |
12 | const emojis= ['🆘','🈲','⚠️','🔞','📵','🚦','🏖','🖥','📺','🐧','🐬','🦉','🍄','⛳️','🚴','🤑','👽','🤖','🎃', '👺', '👁', '🐶', '🐼','🐌', '👥']
13 |
14 | function getRandomInt(max) {
15 | return Math.floor(Math.random() * Math.floor(max));
16 | }
17 |
18 | function ValidCheck(para) {
19 | if(para) {
20 | return para
21 | } else
22 | {
23 | return emojis[getRandomInt(emojis.length)]
24 | }
25 | }
26 |
27 | var flags = new Map([[ "AC" , "🇦🇨" ] ,["AE","🇦🇪"], [ "AF" , "🇦🇫" ] , [ "AI" , "🇦🇮" ] , [ "AL" , "🇦🇱" ] , [ "AM" , "🇦🇲" ] , [ "AQ" , "🇦🇶" ] , [ "AR" , "🇦🇷" ] , [ "AS" , "🇦🇸" ] , [ "AT" , "🇦🇹" ] , [ "AU" , "🇦🇺" ] , [ "AW" , "🇦🇼" ] , [ "AX" , "🇦🇽" ] , [ "AZ" , "🇦🇿" ] , ["BA", "🇧🇦"], [ "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" , "🇿🇦"]])
28 | var body = $response.body;
29 | var obj = JSON.parse(body);
30 | var title = flags.get(obj['country_iso']) + ' '+ obj['country'];
31 | var subtitle =''+ValidCheck(obj['city'])+'-'+'('+obj['asn_org']+')'+'';
32 | var ip = obj['ip'];
33 | var description = obj['country'] + '-' +ValidCheck(obj['city']) + '\n' + obj['asn'] + '\n' + obj['asn_org']+ '\n' + obj['ip'];
34 |
35 | $done({title, subtitle, ip, description});
36 |
--------------------------------------------------------------------------------
/Scripts/geo_location.js:
--------------------------------------------------------------------------------
1 | /***
2 | [task_local]
3 | event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/geo_location.js, tag=GeoIP 查询, img-url=location.fill.viewfinder.system
4 |
5 | @XIAO_KOP
6 |
7 | **/
8 |
9 | // var content= `
` + response.body + `
`; 10 | 11 | var url = "https://api.ip.sb/geoip" 12 | var opts = { 13 | policy: $environment.params 14 | }; 15 | var myRequest = { 16 | url: url, 17 | opts: opts, 18 | timeout: 4000 19 | }; 20 | 21 | var message = "" 22 | const paras = ["ip","isp","country_code","city"] 23 | const paran = ["IP","ISP","地区","城市"] 24 | $task.fetch(myRequest).then(response => { 25 | message = response? json2info(response.body,paras) : "" 26 | $done({"title": " 🔎 IP.SB 查询结果", "htmlMessage": message}); 27 | }, reason => { 28 | message = "🛑 查询超时" 29 | message = `` + message + `
` 30 | $done({"title": "🔎 IP.SB 查询结果", "htmlMessage": message}); 31 | }) 32 | 33 | 34 | function json2info(cnt,paras) { 35 | var res = "------------------------------" 36 | cnt =JSON.parse(cnt) 37 | for (i=0;i` + res + `
` 43 | return res 44 | } 45 | 46 | 47 | var flags = new Map([[ "AC" , "🇦🇨" ] ,["AE","🇦🇪"], [ "AF" , "🇦🇫" ] , [ "AI" , "🇦🇮" ] , [ "AL" , "🇦🇱" ] , [ "AM" , "🇦🇲" ] , [ "AQ" , "🇦🇶" ] , [ "AR" , "🇦🇷" ] , [ "AS" , "🇦🇸" ] , [ "AT" , "🇦🇹" ] , [ "AU" , "🇦🇺" ] , [ "AW" , "🇦🇼" ] , [ "AX" , "🇦🇽" ] , [ "AZ" , "🇦🇿" ] , ["BA", "🇧🇦"], [ "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" , "🇿🇦"]]) 48 | -------------------------------------------------------------------------------- /Scripts/IP_bili_cn.js: -------------------------------------------------------------------------------- 1 | if ($response.statusCode != 200) { 2 | $done(null); 3 | } 4 | 5 | const emojis= ['🆘','🈲','⚠️','🔞','📵','🚦','🏖','🖥','📺','🐧','🐬','🦉','🍄','⛳️','🚴','🤑','👽','🤖','🎃', '👺', '👁', '🐶', '🐼','🐌', '👥'] 6 | var city0 = "高谭市"; 7 | var isp0 = "Cross-GFW.org"; 8 | function getRandomInt(max) { 9 | return Math.floor(Math.random() * Math.floor(max)); 10 | } 11 | 12 | function City_ValidCheck(para) { 13 | if(para) { 14 | if (para.length<6) { 15 | return para 16 | } else { 17 | return para.slice(0,5) 18 | } 19 | 20 | } else 21 | { 22 | return city0 23 | //emojis[getRandomInt(emojis.length)] 24 | } 25 | } 26 | 27 | function ISP_ValidCheck(para) { 28 | if(para) { 29 | return para 30 | } else 31 | { 32 | return isp0 33 | //emojis[getRandomInt(emojis.length)] 34 | } 35 | } 36 | 37 | function Area_check(para) { 38 | if(para=="中华民国"){ 39 | return "台湾" 40 | } else 41 | { 42 | return para 43 | } 44 | } 45 | 46 | var flags = new Map([ [ "巴基斯坦" , "🇵🇰" ] ,[ "乌克兰" , "🇺🇦" ] ,[ "新西兰" , "🇳🇿" ] ,[ "南非" , "🇦🇫" ] , [ "安吉拉" , "🇦🇮" ] , [ "阿尔巴尼亚" , "🇦🇱" ] , [ "亚美尼亚" , "🇦🇲" ] , [ "南极洲" , "🇦🇶" ] , [ "阿根廷" , "🇦🇷" ] , [ "美属萨尼亚" , "🇦🇸" ] , [ "奥地利" , "🇦🇹" ] , [ "澳大利亚" , "🇦🇺" ] , [ "阿鲁巴" , "🇦🇼" ] , [ "奥兰" , "🇦🇽" ] , [ "阿塞拜疆" , "🇦🇿" ] , [ "巴巴多斯" , "🇧🇧" ] , [ "孟加拉" , "🇧🇩" ] , [ "比利时" , "🇧🇪" ] , [ "布基纳法索" , "🇧🇫" ] , [ "保加利亚" , "🇧🇬" ] , [ "巴林" , "🇧🇭" ] , [ "布隆迪" , "🇧🇮" ] , [ "贝宁" , "🇧🇯" ] , [ "百慕大" , "🇧🇲" ] , [ "文莱" , "🇧🇳" ] , [ "玻利维亚" , "🇧🇴" ] , [ "巴西" , "🇧🇷" ] , [ "巴哈马" , "🇧🇸" ] , [ "不丹" , "🇧🇹" ] , [ "挪威" , "🇧🇻" ] , [ "博茨瓦纳" , "🇧🇼" ] , [ "白俄罗斯" , "🇧🇾" ] , [ "伯利兹" , "🇧🇿" ] , [ "加拿大" , "🇨🇦" ] , [ "中非共和国" , "🇨🇫" ] , [ "瑞士" , "🇨🇭" ] , [ "库克群岛" , "🇨🇰" ] , [ "智利" , "🇨🇱" ] , [ "喀麦隆" , "🇨🇲" ] , [ "中国" , "🇨🇳" ] , [ "哥伦比亚" , "🇨🇴" ] , [ "CP" , "🇨🇵" ] , [ "哥斯达黎加" , "🇨🇷" ] , [ "古巴" , "🇨🇺" ] , [ "佛得角" , "🇨🇻" ] , [ "库拉索" , "🇨🇼" ] , [ "圣诞岛" , "🇨🇽" ] , [ "塞浦路斯" , "🇨🇾" ] , [ "捷克" , "🇨🇿" ] , [ "德国" , "🇩🇪" ] , [ "DG" , "🇩🇬" ] , [ "吉布提" , "🇩🇯" ] , [ "丹麦" , "🇩🇰" ] , [ "多米尼克" , "🇩🇲" ] , [ "多米尼加" , "🇩🇴" ] , [ "阿尔及利亚" , "🇩🇿" ] , [ "西班牙" , "🇪🇦" ] , [ "厄瓜多尔" , "🇪🇨" ] , [ "爱沙尼亚" , "🇪🇪" ] , [ "埃及" , "🇪🇬" ] , [ "西撒哈拉" , "🇪🇭" ] , [ "厄立特里亚" , "🇪🇷" ] , [ "西班牙" , "🇪🇸" ] , [ "埃塞俄比亚" , "🇪🇹" ] , [ "欧盟" , "🇪🇺" ] , [ "芬兰" , "🇫🇮" ] , [ "斐济" , "🇫🇯" ] , [ "福克兰群岛" , "🇫🇰" ] , [ "密克罗尼西亚联邦" , "🇫🇲" ] , [ "法罗群岛" , "🇫🇴" ] , [ "法国" , "🇫🇷" ] , [ "加蓬" , "🇬🇦" ] , [ "英国" , "🇬🇧" ] , [ "香港" , "🇭🇰" ] ,["匈牙利","🇭🇺"], [ "印度尼西亚" , "🇮🇩" ] , [ "爱尔兰" , "🇮🇪" ] , [ "以色列" , "🇮🇱" ] , [ "曼岛" , "🇮🇲" ] , [ "印度" , "🇮🇳" ] , [ "冰岛" , "🇮🇸" ] , [ "意大利" , "🇮🇹" ] , [ "日本" , "🇯🇵" ] , [ "韩国" , "🇰🇷" ] , [ "卢森堡" , "🇱🇺" ] , [ "澳门" , "🇲🇴" ] , [ "墨西哥" , "🇲🇽" ] , [ "马来西亚" , "🇲🇾" ] , [ "荷兰" , "🇳🇱" ] , [ "菲律宾" , "🇵🇭" ] , [ "罗马尼亚" , "🇷🇴" ] , [ "塞尔维亚" , "🇷🇸" ] , [ "俄罗斯" , "🇷🇺" ] , [ "卢旺达" , "🇷🇼" ] , [ "沙特阿拉伯" , "🇸🇦" ] , [ "所罗门群岛" , "🇸🇧" ] , [ "塞舌尔" , "🇸🇨" ] , [ "苏丹" , "🇸🇩" ] , [ "瑞典" , "🇸🇪" ] , [ "新加坡" , "🇸🇬" ] , [ "泰国" , "🇹🇭" ] , [ "突尼西亚" , "🇹🇳" ] , [ "汤加" , "🇹🇴" ] , [ "土耳其" , "🇹🇷" ] , [ "图瓦卢" , "🇹🇻" ] , [ "台湾" , "🇨🇳" ] , [ "英国" , "🇬🇧" ] , [ "美属离岛" , "🇺🇲" ] , [ "美国" , "🇺🇸" ] , [ "乌拉圭" , "🇺🇾" ] , [ "乌兹别克" , "🇺🇿" ] , [ "梵蒂冈" , "🇻🇦" ] , [ "委内瑞拉" , "🇻🇪" ] , [ "英属维京群岛" , "🇻🇬" ] , [ "美属维京群岛" , "🇻🇮" ] , [ "越南" , "🇻🇳" ] , [ "南非" , "🇿🇦"], ["马恩岛", "🇮🇲"],["波斯尼亚和黑塞哥维那","🇧🇦"],["阿联酋","🇦🇪"]]) 47 | 48 | 49 | var body = $response.body; 50 | var obj = JSON.parse(body)["data"]; 51 | var emoji = flags.get(obj['country'])? flags.get(obj['country']):"🏴☠️" 52 | emoji=City_ValidCheck(obj['province']) == "香港"? "🇭🇰️":emoji 53 | emoji=City_ValidCheck(obj['province']) == "澳门"? "️🇲🇴️":emoji 54 | // emoji=City_ValidCheck(obj['province']) == "台湾"? "️️🇹🇼":emoji 55 | var title = emoji +'『'+ City_ValidCheck(obj['province'])+'』';//+Area_check(obj['country']); 56 | var subtitle = "💋 "+ ISP_ValidCheck(obj['isp']) + " ➠ "+ obj['country']; 57 | var ip = obj['addr']; 58 | var description = '服务商:'+obj['isp'] + '\n'+'定位: [' +obj["latitude"]+","+obj["longitude"]+"]"+ '\n' + 'IP:'+ obj['addr'] + '\n' +'时区:'+ obj['timezone']; 59 | $done({title, subtitle, ip, description}); 60 | -------------------------------------------------------------------------------- /Scripts/IP_bili.js: -------------------------------------------------------------------------------- 1 | if ($response.statusCode != 200) { 2 | $done(null); 3 | } 4 | 5 | console.log("haha") 6 | const emojis= ['🆘','🈲','⚠️','🔞','📵','🚦','🏖','🖥','📺','🐧','🐬','🦉','🍄','⛳️','🚴','🤑','👽','🤖','🎃', '👺', '👁', '🐶', '🐼','🐌', '👥'] 7 | var city0 = "高谭市"; 8 | var isp0 = "Cross-GFW.org"; 9 | function getRandomInt(max) { 10 | return Math.floor(Math.random() * Math.floor(max)); 11 | } 12 | 13 | function City_ValidCheck(para) { 14 | if(para) { 15 | if (para.length<7) { 16 | return para 17 | } else { 18 | return para.slice(0,6) 19 | } 20 | 21 | } else 22 | { 23 | return city0 24 | //emojis[getRandomInt(emojis.length)] 25 | } 26 | } 27 | 28 | function ISP_ValidCheck(para) { 29 | if(para) { 30 | return para 31 | } else 32 | { 33 | return isp0 34 | //emojis[getRandomInt(emojis.length)] 35 | } 36 | } 37 | 38 | function Area_check(para) { 39 | if(para=="中华民国"){ 40 | return "台湾" 41 | } else 42 | { 43 | return para 44 | } 45 | } 46 | 47 | var flags = new Map([ [ "巴基斯坦" , "🇵🇰" ] ,[ "乌克兰" , "🇺🇦" ] ,[ "新西兰" , "🇳🇿" ] ,[ "南非" , "🇦🇫" ] , [ "安吉拉" , "🇦🇮" ] , [ "阿尔巴尼亚" , "🇦🇱" ] , [ "亚美尼亚" , "🇦🇲" ] , [ "南极洲" , "🇦🇶" ] , [ "阿根廷" , "🇦🇷" ] , [ "美属萨尼亚" , "🇦🇸" ] , [ "奥地利" , "🇦🇹" ] , [ "澳大利亚" , "🇦🇺" ] , [ "阿鲁巴" , "🇦🇼" ] , [ "奥兰" , "🇦🇽" ] , [ "阿塞拜疆" , "🇦🇿" ] , [ "巴巴多斯" , "🇧🇧" ] , [ "孟加拉" , "🇧🇩" ] , [ "比利时" , "🇧🇪" ] , [ "布基纳法索" , "🇧🇫" ] , [ "保加利亚" , "🇧🇬" ] , [ "巴林" , "🇧🇭" ] , [ "布隆迪" , "🇧🇮" ] , [ "贝宁" , "🇧🇯" ] , [ "百慕大" , "🇧🇲" ] , [ "文莱" , "🇧🇳" ] , [ "玻利维亚" , "🇧🇴" ] , [ "巴西" , "🇧🇷" ] , [ "巴哈马" , "🇧🇸" ] , [ "不丹" , "🇧🇹" ] , [ "挪威" , "🇧🇻" ] , [ "博茨瓦纳" , "🇧🇼" ] , [ "白俄罗斯" , "🇧🇾" ] , [ "伯利兹" , "🇧🇿" ] , [ "加拿大" , "🇨🇦" ] , [ "中非共和国" , "🇨🇫" ] , [ "瑞士" , "🇨🇭" ] , [ "库克群岛" , "🇨🇰" ] , [ "智利" , "🇨🇱" ] , [ "喀麦隆" , "🇨🇲" ] , [ "中国" , "🇨🇳" ] , [ "哥伦比亚" , "🇨🇴" ] , [ "CP" , "🇨🇵" ] , [ "哥斯达黎加" , "🇨🇷" ] , [ "古巴" , "🇨🇺" ] , [ "佛得角" , "🇨🇻" ] , [ "库拉索" , "🇨🇼" ] , [ "圣诞岛" , "🇨🇽" ] , [ "塞浦路斯" , "🇨🇾" ] , [ "捷克" , "🇨🇿" ] , [ "德国" , "🇩🇪" ] , [ "DG" , "🇩🇬" ] , [ "吉布提" , "🇩🇯" ] , [ "丹麦" , "🇩🇰" ] , [ "多米尼克" , "🇩🇲" ] , [ "多米尼加" , "🇩🇴" ] , [ "阿尔及利亚" , "🇩🇿" ] , [ "西班牙" , "🇪🇦" ] , [ "厄瓜多尔" , "🇪🇨" ] , [ "爱沙尼亚" , "🇪🇪" ] , [ "埃及" , "🇪🇬" ] , [ "西撒哈拉" , "🇪🇭" ] , [ "厄立特里亚" , "🇪🇷" ] , [ "西班牙" , "🇪🇸" ] , [ "埃塞俄比亚" , "🇪🇹" ] , [ "欧盟" , "🇪🇺" ] , [ "芬兰" , "🇫🇮" ] , [ "斐济" , "🇫🇯" ] , [ "福克兰群岛" , "🇫🇰" ] , [ "密克罗尼西亚联邦" , "🇫🇲" ] , [ "法罗群岛" , "🇫🇴" ] , [ "法国" , "🇫🇷" ] , [ "加蓬" , "🇬🇦" ] , [ "英国" , "🇬🇧" ] , [ "香港" , "🇭🇰" ] ,["匈牙利","🇭🇺"], [ "印度尼西亚" , "🇮🇩" ] , [ "爱尔兰" , "🇮🇪" ] , [ "以色列" , "🇮🇱" ] , [ "曼岛" , "🇮🇲" ] , [ "印度" , "🇮🇳" ] , [ "冰岛" , "🇮🇸" ] , [ "意大利" , "🇮🇹" ] , [ "日本" , "🇯🇵" ] , [ "韩国" , "🇰🇷" ] , [ "卢森堡" , "🇱🇺" ] , [ "澳门" , "🇲🇴" ] , [ "墨西哥" , "🇲🇽" ] , [ "马来西亚" , "🇲🇾" ] , [ "荷兰" , "🇳🇱" ] , [ "菲律宾" , "🇵🇭" ] , [ "罗马尼亚" , "🇷🇴" ] , [ "塞尔维亚" , "🇷🇸" ] , [ "俄罗斯" , "🇷🇺" ] , [ "卢旺达" , "🇷🇼" ] , [ "沙特阿拉伯" , "🇸🇦" ] , [ "所罗门群岛" , "🇸🇧" ] , [ "塞舌尔" , "🇸🇨" ] , [ "苏丹" , "🇸🇩" ] , [ "瑞典" , "🇸🇪" ] , [ "新加坡" , "🇸🇬" ] , [ "泰国" , "🇹🇭" ] , [ "突尼西亚" , "🇹🇳" ] , [ "汤加" , "🇹🇴" ] , [ "土耳其" , "🇹🇷" ] , [ "图瓦卢" , "🇹🇻" ] , [ "台湾" , "🇨🇳" ] , [ "英国" , "🇬🇧" ] , [ "美属离岛" , "🇺🇲" ] , [ "美国" , "🇺🇸" ] , [ "乌拉圭" , "🇺🇾" ] , [ "乌兹别克" , "🇺🇿" ] , [ "梵蒂冈" , "🇻🇦" ] , [ "委内瑞拉" , "🇻🇪" ] , [ "英属维京群岛" , "🇻🇬" ] , [ "美属维京群岛" , "🇻🇮" ] , [ "越南" , "🇻🇳" ] , [ "南非" , "🇿🇦"], ["马恩岛", "🇮🇲"],["波斯尼亚和黑塞哥维那","🇧🇦"],["阿联酋","🇦🇪"]]) 48 | var body = $response.body; 49 | var obj = JSON.parse(body)["data"]; 50 | var emoji = flags.get(obj['country'])? flags.get(obj['country']):"🏴☠️" 51 | emoji=City_ValidCheck(obj['province']) == "香港"? "🇭🇰️":emoji 52 | emoji=City_ValidCheck(obj['province']) == "澳门"? "️🇲🇴️":emoji 53 | emoji=City_ValidCheck(obj['province']) == "台湾"? "️️🇹🇼":emoji 54 | var title = emoji + "" + '「'+ City_ValidCheck(obj['province'])+"」";//+Area_check(obj['country']); 55 | var subtitle = ""+ ISP_ValidCheck(obj['isp']).toUpperCase() + " ™"+ " ➠ "+ obj['country']; 56 | var ip = obj['addr']; 57 | var description = '服务商:'+obj['isp'] + '\n'+'定位: [' +obj["latitude"]+","+obj["longitude"]+"]"+ '\n' + 'IP:'+ obj['addr'] + '\n' +'时区:'+ obj['timezone']; 58 | $done({title, subtitle, ip, description}); 59 | -------------------------------------------------------------------------------- /Scripts/IP_API.js: -------------------------------------------------------------------------------- 1 | if ($response.statusCode != 200) { 2 | $done(null); 3 | } 4 | 5 | const emojis= ['🆘','🈲','⚠️','🔞','📵','🚦','🏖','🖥','📺','🐧','🐬','🦉','🍄','⛳️','🚴','🤑','👽','🤖','🎃', '👺', '👁', '🐶', '🐼','🐌', '👥'] 6 | var city0 = "高谭市"; 7 | var isp0 = "Cross-GFW.org"; 8 | function getRandomInt(max) { 9 | return Math.floor(Math.random() * Math.floor(max)); 10 | } 11 | 12 | function City_ValidCheck(para) { 13 | if(para) { 14 | return para 15 | } else 16 | { 17 | return city0 18 | //emojis[getRandomInt(emojis.length)] 19 | } 20 | } 21 | 22 | function ISP_ValidCheck(para) { 23 | if(para) { 24 | return para 25 | } else 26 | { 27 | return isp0 28 | //emojis[getRandomInt(emojis.length)] 29 | } 30 | } 31 | 32 | function Area_check(para) { 33 | if(para=="中华民国"){ 34 | return "台湾" 35 | } else 36 | { 37 | return para 38 | } 39 | } 40 | 41 | var flags = new Map([["AC","🇦🇨"],["AD","🇦🇩"],["AE","🇦🇪"],["AF","🇦🇫"],["AG","🇦🇬"],["AI","🇦🇮"],["AL","🇦🇱"],["AM","🇦🇲"],["AO","🇦🇴"],["AQ","🇦🇶"],["AR","🇦🇷"],["AS","🇦🇸"],["AT","🇦🇹"],["AU","🇦🇺"],["AW","🇦🇼"],["AX","🇦🇽"],["AZ","🇦🇿"],["BA","🇧🇦"],["BB","🇧🇧"],["BD","🇧🇩"],["BE","🇧🇪"],["BF","🇧🇫"],["BG","🇧🇬"],["BH","🇧🇭"],["BI","🇧🇮"],["BJ","🇧🇯"],["BM","🇧🇲"],["BN","🇧🇳"],["BO","🇧🇴"],["BR","🇧🇷"],["BS","🇧🇸"],["BT","🇧🇹"],["BV","🇧🇻"],["BW","🇧🇼"],["BY","🇧🇾"],["BZ","🇧🇿"],["CA","🇨🇦"],["CD","🇨🇩"],["CF","🇨🇫"],["CG","🇨🇬"],["CH","🇨🇭"],["CI","🇨🇮"],["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","🇬🇧"],["GD","🇬🇩"],["GE","🇬🇪"],["GF","🇬🇫"],["GH","🇬🇭"],["GI","🇬🇮"],["GL","🇬🇱"],["GM","🇬🇲"],["GN","🇬🇳"],["GP","🇬🇵"],["GR","🇬🇷"],["GT","🇬🇹"],["GU","🇬🇺"],["GW","🇬🇼"],["GY","🇬🇾"],["HK","🇭🇰"],["HN","🇭🇳"],["HR","🇭🇷"],["HT","🇭🇹"],["HU","🇭🇺"],["ID","🇮🇩"],["IE","🇮🇪"],["IL","🇮🇱"],["IM","🇮🇲"],["IN","🇮🇳"],["IR","🇮🇷"],["IS","🇮🇸"],["IT","🇮🇹"],["JM","🇯🇲"],["JO","🇯🇴"],["JP","🇯🇵"],["KE","🇰🇪"],["KG","🇰🇬"],["KH","🇰🇭"],["KI","🇰🇮"],["KM","🇰🇲"],["KN","🇰🇳"],["KP","🇰🇵"],["KR","🇰🇷"],["KW","🇰🇼"],["KY","🇰🇾"],["KZ","🇰🇿"],["LA","🇱🇦"],["LB","🇱🇧"],["LC","🇱🇨"],["LI","🇱🇮"],["LK","🇱🇰"],["LR","🇱🇷"],["LS","🇱🇸"],["LT","🇱🇹"],["LU","🇱🇺"],["LV","🇱🇻"],["LY","🇱🇾"],["MA","🇲🇦"],["MC","🇲🇨"],["MD","🇲🇩"],["MG","🇲🇬"],["MH","🇲🇭"],["MK","🇲🇰"],["ML","🇲🇱"],["MM","🇲🇲"],["MN","🇲🇳"],["MO","🇲🇴"],["MP","🇲🇵"],["MQ","🇲🇶"],["MR","🇲🇷"],["MS","🇲🇸"],["MT","🇲🇹"],["MU","🇲🇺"],["MV","🇲🇻"],["MW","🇲🇼"],["MX","🇲🇽"],["MY","🇲🇾"],["MZ","🇲🇿"],["NA","🇳🇦"],["NC","🇳🇨"],["NE","🇳🇪"],["NF","🇳🇫"],["NG","🇳🇬"],["NI","🇳🇮"],["NL","🇳🇱"],["NO","🇳🇴"],["NP","🇳🇵"],["NR","🇳🇷"],["NZ","🇳🇿"],["OM","🇴🇲"],["PA","🇵🇦"],["PE","🇵🇪"],["PF","🇵🇫"],["PG","🇵🇬"],["PH","🇵🇭"],["PK","🇵🇰"],["PL","🇵🇱"],["PM","🇵🇲"],["PR","🇵🇷"],["PS","🇵🇸"],["PT","🇵🇹"],["PW","🇵🇼"],["PY","🇵🇾"],["QA","🇶🇦"],["RE","🇷🇪"],["RO","🇷🇴"],["RS","🇷🇸"],["RU","🇷🇺"],["RW","🇷🇼"],["SA","🇸🇦"],["SB","🇸🇧"],["SC","🇸🇨"],["SD","🇸🇩"],["SE","🇸🇪"],["SG","🇸🇬"],["SI","🇸🇮"],["SK","🇸🇰"],["SL","🇸🇱"],["SM","🇸🇲"],["SN","🇸🇳"],["SR","🇸🇷"],["ST","🇸🇹"],["SV","🇸🇻"],["SY","🇸🇾"],["SZ","🇸🇿"],["TC","🇹🇨"],["TD","🇹🇩"],["TG","🇹🇬"],["TH","🇹🇭"],["TJ","🇹🇯"],["TL","🇹🇱"],["TM","🇹🇲"],["TN","🇹🇳"],["TO","🇹🇴"],["TR","🇹🇷"],["TT","🇹🇹"],["TV","🇹🇻"],["TW","🇨🇳"],["TZ","🇹🇿"],["UA","🇺🇦"],["UG","🇺🇬"],["UK","🇬🇧"],["UM","🇺🇲"],["US","🇺🇸"],["UY","🇺🇾"],["UZ","🇺🇿"],["VA","🇻🇦"],["VC","🇻🇨"],["VE","🇻🇪"],["VG","🇻🇬"],["VI","🇻🇮"],["VN","🇻🇳"],["VU","🇻🇺"],["WS","🇼🇸"],["YE","🇾🇪"],["YT","🇾🇹"],["ZA","🇿🇦"],["ZM","🇿🇲"],["ZW","🇿🇼"]]) 42 | 43 | var body = $response.body; 44 | var obj = JSON.parse(body); 45 | var title =flags.get(obj['countryCode']) + ' '+ City_ValidCheck(obj['city']);//+Area_check(obj['country']); 46 | var subtitle = ISP_ValidCheck(obj['org']); 47 | var ip = obj['query']; 48 | var description = '服务商:'+obj['isp'] + '\n'+'地区:' +City_ValidCheck(obj['regionName'])+ '\n' + 'IP:'+ obj['query'] + '\n' +'时区:'+ obj['timezone']; 49 | $done({title, subtitle, ip, description}); 50 | -------------------------------------------------------------------------------- /Scripts/ytb-ui-check.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | Thanks to & modified from https://gist.githubusercontent.com/Hyseen/b06e911a41036ebc36acf04ddebe7b9a/raw/nf_check.js 4 | 5 | For Quantumult-X 598+ 6 | 7 | [task_local] 8 | 9 | event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/ytb-ui-check.js, tag=YouTube 查询, img-url=text.magnifyingglass.system, enabled=true 10 | 11 | @XIAO_KOP 12 | 13 | **/ 14 | 15 | 16 | const BASE_URL = 'https://www.youtube.com/premium' 17 | 18 | const FILM_ID = 81215567 19 | const link = { "media-url": "https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/img/southpark/7.png" } 20 | 21 | const arrow = "➟" 22 | var output = "" 23 | var opts = { 24 | policy: $environment.params 25 | }; 26 | 27 | 28 | var flags = new Map([[ "AC" , "🇦🇨" ] ,["AE","🇦🇪"], [ "AF" , "🇦🇫" ] , [ "AI" , "🇦🇮" ] , [ "AL" , "🇦🇱" ] , [ "AM" , "🇦🇲" ] , [ "AQ" , "🇦🇶" ] , [ "AR" , "🇦🇷" ] , [ "AS" , "🇦🇸" ] , [ "AT" , "🇦🇹" ] , [ "AU" , "🇦🇺" ] , [ "AW" , "🇦🇼" ] , [ "AX" , "🇦🇽" ] , [ "AZ" , "🇦🇿" ] , ["BA", "🇧🇦"], [ "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" , "🇿🇦"]]) 29 | 30 | 31 | !(async () => { 32 | let result = { 33 | title: '📺 YouTube Premium 检测', 34 | content: '----------------------\n\n检测失败,请重试', 35 | } 36 | await Promise.race([test(FILM_ID),timeOut(5000)]) 37 | .then((code) => { 38 | console.log(code) 39 | 40 | if (code === 'Not Available') { 41 | result['content'] = '----------------------\n\n🛑 未支持 YouTube Premium' 42 | //return 43 | } else if (code === "timeout") { 44 | result['content'] = "----------------------\n\n🚦 测试超时" 45 | } else { 46 | result['content'] = '----------------------\n\n✅ 支持 YouTube Premium ➟ ⟦'+flags.get(code.toUpperCase())+code.toUpperCase()+"⟧" 47 | } 48 | //$notify(result["title"], output, result["content"], link) 49 | 50 | //console.log(result) 51 | $done({"title":result["title"],"message":result["content"]+'\n\n----------------------\n'+$environment.params}) 52 | }) 53 | })() 54 | .finally(() => $done()); 55 | 56 | function timeOut(delay) { 57 | return new Promise((resolve, reject) => { 58 | setTimeout(() => { 59 | //reject(new Error('timeout')) 60 | resolve("timeout") 61 | }, delay) 62 | }) 63 | } 64 | 65 | 66 | function test() { 67 | return new Promise((resolve, reject) => { 68 | let option = { 69 | url: BASE_URL, 70 | opts: opts, 71 | headers: { 72 | 'User-Agent': 73 | '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', 74 | 'Accept-Language': 'en', 75 | }, 76 | } 77 | $task.fetch(option).then(response=> { 78 | let data = response.body 79 | console.log(response.statusCode) 80 | if (response.statusCode !== 200) { 81 | reject('Error') 82 | return 83 | } 84 | 85 | if (data.indexOf('Premium is not available in your country') !== -1) { 86 | resolve('Not Available') 87 | return 88 | } 89 | console.log(data) 90 | let region = '' 91 | let re = new RegExp('"GL":"(.*?)"', 'gm') 92 | let result = re.exec(data) 93 | if (result != null && result.length === 2) { 94 | region = result[1] 95 | } else if (data.indexOf('www.google.cn') !== -1) { 96 | region = 'CN' 97 | } else { 98 | region = 'US' 99 | } 100 | resolve(region) 101 | }) 102 | }) 103 | } 104 | -------------------------------------------------------------------------------- /Scripts/ytbcheck.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | Thanks to & modified https://gist.githubusercontent.com/Hyseen/5ae36a6a5cb5690b1f2bff4aa19c766f/raw/youtube_premium_check.js?version=1632728073 4 | 5 | For Quantumult-X / [task-local] 6 | 7 | @XIAO_KOP 8 | 9 | **/ 10 | 11 | const BASE_URL = 'https://www.youtube.com/premium' 12 | 13 | const link = { "media-url": "https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/img/southpark/7.png" } 14 | const policy_name = "YouTube" //填入你的 youtube 策略组名 15 | 16 | const arrow = "➟" 17 | var output = "" 18 | 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" , "🇿🇦"]]) 19 | 20 | 21 | function ReadPolicy(cnt) { 22 | var res = "" 23 | for (var key in cnt) { 24 | if (key == policy_name){ 25 | dd = cnt[key] 26 | res = res + dd.join(arrow) 27 | break 28 | } 29 | } 30 | return res.split(policy_name+arrow)[1] 31 | } 32 | 33 | const message = { 34 | action: "get_policy_state", 35 | //content: dict 36 | 37 | }; 38 | 39 | 40 | $configuration.sendMessage(message).then(resolve => { 41 | if (resolve.error) { 42 | console.log(resolve.error); 43 | } 44 | if (resolve.ret) { 45 | output = ReadPolicy(resolve.ret) 46 | } 47 | }) 48 | 49 | ;(async () => { 50 | let result = { 51 | title: 'YouTube Premium 检测', 52 | content: '检测失败,请重试', 53 | } 54 | 55 | await Promise.race([test(),timeOut(5000)]) 56 | .then((code) => { 57 | console.log(code) 58 | 59 | if (code === 'Not Available') { 60 | result['content'] = '该节点未解锁 YouTube Premium' 61 | //return 62 | } else if (code === "timeout") { 63 | result['content'] = "测试超时" 64 | } else { 65 | result['content'] = '该节点解锁 YouTube Premium ➟ ⟦'+flags.get(code.toUpperCase())+" 地区⟧" 66 | } 67 | $notify(result["title"], output, result["content"], link) 68 | $done() 69 | }) 70 | .finally(() => { 71 | $done(result) 72 | }) 73 | })() 74 | 75 | function timeOut(delay) { 76 | return new Promise((resolve, reject) => { 77 | setTimeout(() => { 78 | //reject(new Error('timeout')) 79 | resolve("timeout") 80 | }, delay) 81 | }) 82 | } 83 | 84 | 85 | 86 | function test() { 87 | return new Promise((resolve, reject) => { 88 | let option = { 89 | url: BASE_URL, 90 | headers: { 91 | 'User-Agent': 92 | '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', 93 | 'Accept-Language': 'en', 94 | }, 95 | } 96 | $task.fetch(option).then(response=> { 97 | let data = response.body 98 | console.log(response.statusCode) 99 | if (response.statusCode !== 200) { 100 | reject('Error') 101 | return 102 | } 103 | 104 | if (data.indexOf('Premium is not available in your country') !== -1) { 105 | resolve('Not Available') 106 | return 107 | } 108 | 109 | let region = '' 110 | let re = new RegExp('"countryCode":"(.*?)"', 'gm') 111 | let result = re.exec(data) 112 | if (result != null && result.length === 2) { 113 | region = result[1] 114 | } else if (data.indexOf('www.google.cn') !== -1) { 115 | region = 'CN' 116 | } else { 117 | region = 'US' 118 | } 119 | resolve(region) 120 | }) 121 | }) 122 | } 123 | -------------------------------------------------------------------------------- /Scripts/nfcheck.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | Thanks to & modified from https://gist.githubusercontent.com/Hyseen/b06e911a41036ebc36acf04ddebe7b9a/raw/nf_check.js 4 | 5 | For Quantumult-X / [task-local] 6 | 7 | @XIAO_KOP 8 | 9 | **/ 10 | 11 | 12 | const BASE_URL = 'https://www.netflix.com/title/' 13 | 14 | const FILM_ID = 81280792 15 | const link = { "media-url": "https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/img/southpark/7.png" } 16 | const policy_name = "Netflix" //填入你的 netflix 策略组名 17 | 18 | const arrow = "➟" 19 | var output = "" 20 | 21 | 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" , "🇿🇦"]]) 22 | 23 | 24 | function ReadPolicy(cnt) { 25 | var res = "" 26 | for (var key in cnt) { 27 | if (key == policy_name){ 28 | dd = cnt[key] 29 | res = res + dd.join(arrow) 30 | break 31 | } 32 | } 33 | return res.split(policy_name+arrow)[1] 34 | } 35 | 36 | const message = { 37 | action: "get_policy_state", 38 | //content: dict 39 | 40 | }; 41 | 42 | 43 | $configuration.sendMessage(message).then(resolve => { 44 | if (resolve.error) { 45 | console.log(resolve.error); 46 | } 47 | if (resolve.ret) { 48 | output = ReadPolicy(resolve.ret) 49 | } 50 | }) 51 | 52 | 53 | 54 | !(async () => { 55 | let result = { 56 | title: 'Netflix 解锁检测', 57 | subtitle: output, 58 | content: '检测失败,请重试', 59 | } 60 | await Promise.race([test(FILM_ID),timeOut(5000)]) 61 | .then((code) => { 62 | console.log(code) 63 | 64 | if (code === 'Not Available') { 65 | result['content'] = '该节点未解锁 Netflix' 66 | //return 67 | //console.log(result) 68 | } else if (code === 'Not Found') { 69 | result['content'] = '该节点仅支持解锁 Netflix 自制剧' 70 | //return 71 | } else if (code === "timeout") { 72 | result['content'] = "测试超时" 73 | } else { 74 | result['content'] = '该节点完整解锁 Netflix ➟ ⟦'+flags.get(code.toUpperCase())+" 地区⟧" 75 | } 76 | 77 | $notify(result["title"], output, result["content"], link) 78 | 79 | //console.log(result) 80 | $done() 81 | }) 82 | })() 83 | .finally(() => $.done()); 84 | 85 | function timeOut(delay) { 86 | return new Promise((resolve, reject) => { 87 | setTimeout(() => { 88 | //reject(new Error('timeout')) 89 | resolve("timeout") 90 | }, delay) 91 | }) 92 | } 93 | 94 | function test(filmId) { 95 | return new Promise((resolve, reject) => { 96 | let option = { 97 | url: BASE_URL + filmId, 98 | headers: { 99 | 'User-Agent': 100 | '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', 101 | }, 102 | } 103 | $task.fetch(option).then (response => { 104 | console.log(response.statusCode) 105 | if (response.statusCode === 404) { 106 | resolve('Not Found') 107 | return 108 | } 109 | 110 | if (response.statusCode === 403) { 111 | resolve('Not Available') 112 | return 113 | } 114 | 115 | if (response.statusCode === 200) { 116 | let url = response.headers['X-Originating-URL'] 117 | let region = url.split('/')[3] 118 | region = region.split('-')[0] 119 | if (region == 'title') { 120 | region = 'us' 121 | } 122 | resolve(region) 123 | return 124 | } 125 | reject('Error') 126 | }) 127 | }) 128 | } 129 | -------------------------------------------------------------------------------- /Scripts/nf-ui-check.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | Thanks to & modified from https://gist.githubusercontent.com/Hyseen/b06e911a41036ebc36acf04ddebe7b9a/raw/nf_check.js 4 | 5 | For Quantumult-X 598+ 6 | 7 | [task-local] 8 | 9 | event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/nf-ui-check.js, tag=Netflix 查询, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Netflix.png, enabled=true 10 | 11 | @XIAO_KOP 12 | 13 | **/ 14 | 15 | const BASE_URL = 'https://www.netflix.com/title/' 16 | 17 | const FILM_ID = 81280792 18 | const link = { "media-url": "https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/img/southpark/7.png" } 19 | const policy_name = "Netflix" //填入你的 netflix 策略组名 20 | 21 | const arrow = "➟" 22 | var output = "" 23 | var opts = { 24 | policy: $environment.params 25 | }; 26 | 27 | 28 | var flags = new Map([[ "AC" , "🇦🇨" ] ,["AE","🇦🇪"], [ "AF" , "🇦🇫" ] , [ "AI" , "🇦🇮" ] , [ "AL" , "🇦🇱" ] , [ "AM" , "🇦🇲" ] , [ "AQ" , "🇦🇶" ] , [ "AR" , "🇦🇷" ] , [ "AS" , "🇦🇸" ] , [ "AT" , "🇦🇹" ] , [ "AU" , "🇦🇺" ] , [ "AW" , "🇦🇼" ] , [ "AX" , "🇦🇽" ] , [ "AZ" , "🇦🇿" ] , ["BA", "🇧🇦"], [ "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" , "🇿🇦"]]) 29 | 30 | 31 | !(async () => { 32 | let result = { 33 | title: ' Netflix 解锁检测', 34 | subtitle: output, 35 | content: '检测失败,请重试', 36 | } 37 | await Promise.race([test(FILM_ID),timeOut(5000)]) 38 | .then((code) => { 39 | console.log(code) 40 | 41 | if (code === 'Not Available') { 42 | result['content'] = '该节点未解锁 Netflix' 43 | //return 44 | //console.log(result) 45 | } else if (code === 'Not Found') { 46 | result['content'] = '该节点仅支持解锁 Netflix 自制剧' 47 | //return 48 | } else if (code === "timeout") { 49 | result['content'] = "测试超时" 50 | } else { 51 | result['content'] = '该节点完整解锁 Netflix ➟ ⟦'+flags.get(code.toUpperCase())+" 地区⟧" 52 | } 53 | 54 | //$notify(result["title"], output, result["content"], link) 55 | 56 | //console.log(result) 57 | let content = "------------------------------"+""+result["content"] 58 | content = content + "------------------------------"+""+"节点 ➟ " + $environment.params+ "" 59 | content =`` + content + `
` 60 | $done({"title":"Netflix 解锁检测","htmlMessage":content}) 61 | }) 62 | })() 63 | .finally(() => $done()); 64 | 65 | function timeOut(delay) { 66 | return new Promise((resolve, reject) => { 67 | setTimeout(() => { 68 | //reject(new Error('timeout')) 69 | resolve("timeout") 70 | }, delay) 71 | }) 72 | } 73 | 74 | 75 | function test(filmId) { 76 | return new Promise((resolve, reject) => { 77 | let option = { 78 | url: BASE_URL + filmId, 79 | opts: opts, 80 | headers: { 81 | 'User-Agent': 82 | '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', 83 | }, 84 | } 85 | $task.fetch(option).then (response => { 86 | console.log(response.statusCode) 87 | if (response.statusCode === 404) { 88 | resolve('Not Found') 89 | return 90 | } 91 | 92 | if (response.statusCode === 403) { 93 | resolve('Not Available') 94 | return 95 | } 96 | 97 | if (response.statusCode === 200) { 98 | let url = response.headers['X-Originating-URL'] 99 | let region = url.split('/')[3] 100 | region = region.split('-')[0] 101 | if (region == 'title') { 102 | region = 'us' 103 | } 104 | resolve(region) 105 | return 106 | } 107 | reject('Error') 108 | }) 109 | }) 110 | } 111 | -------------------------------------------------------------------------------- /Scripts/emoji.json: -------------------------------------------------------------------------------- 1 | { 2 | "🏳️🌈": ["流量", "套餐", "剩余", "重置", "到期" , "时间", "应急", "过期", "Bandwidth", "expire", "Traffic", "traffic"], 3 | "🇦🇩": ["安道尔", "Andorra"], 4 | "🇦🇿": ["阿塞拜疆","Azerbaijan"], 5 | "🇦🇹": ["奥地利", "奧地利", "Austria", "维也纳"], 6 | "🇦🇺": ["AU", "Australia", "Sydney", "澳大利亚", "澳洲", "墨尔本", "悉尼" ,"土澳", "京澳","廣澳","滬澳","沪澳","广澳"], 7 | "🇧🇪": ["BE", "比利時","比利时","Belgium"], 8 | "🇧🇬": ["保加利亚", "保加利亞","Bulgaria"], 9 | "🇵🇰": ["巴基斯坦","Pakistan", "PAKISTAN"], 10 | "🇧🇭": ["巴林","Bahrain"], 11 | "🇵🇾": ["巴拉圭","Paraguay"], 12 | "🇰🇭": ["柬埔寨","Cambodia"], 13 | "🇺🇦": ["烏克蘭","乌克兰","Ukraine"], 14 | "🇺🇿": ["乌兹别克斯坦", "烏茲別克斯坦","Uzbekistan"], 15 | "🇭🇷": ["克罗地亚","HR","克羅地亞", "Croatia"], 16 | "🇨🇦": ["CA", "Canada","CANADA", "CAN", "Waterloo", "加拿大", "蒙特利尔", "温哥华", "楓葉", "枫叶", "滑铁卢", "多伦多"], 17 | "🇨🇭": ["瑞士", "苏黎世", "Switzerland"], 18 | "🇳🇬": ["尼日利亚", "NG", "尼日利亞","拉各斯", "Nigeria"], 19 | "🇨🇿": ["Czechia", "捷克"], 20 | "🇸🇰": ["斯洛伐克", "SK" , "Slovakia"], 21 | "🇸🇮": ["斯洛文尼亚", "斯洛文尼亞", "Slovenia"], 22 | "🇦🇲": ["亚美尼亚", "亞美尼亞", "Armenia"], 23 | "🇷🇸": ["RS ","RS_", "塞尔维亚", "塞爾維亞", "Seville", "Sevilla"], 24 | "🇲🇩": ["摩爾多瓦","MD","摩尔多瓦", "Moldova"], 25 | "🇩🇪": [" DE ", "DE-", "DE_", "German", "GERMAN", "德国", "德國", "法兰克福","京德","滬德","廣德","沪德","广德"], 26 | "🇩🇰": ["DK","DNK","丹麦","丹麥", "Denmark"], 27 | "🇪🇸": ["ES", "西班牙", "Spain"], 28 | "🇪🇺": ["EU", "欧盟", "欧罗巴","欧洲", "European"], 29 | "🇫🇮": ["Finland", "芬兰","芬蘭","赫尔辛基"], 30 | "🇫🇷": ["FR", "France", "法国", "法國", "巴黎"], 31 | "🇷🇪": ["留尼汪", "留尼旺", "Réunion", "Reunion"], 32 | "🇨🇼": ["库拉索", "庫拉索", "Curaçao"], 33 | "🇬🇧": ["UK", "GB ", "England", "United Kingdom", "英国", "伦敦", "英"], 34 | "🇲🇴": ["MO", "Macao","Macau", "MAC", "澳门", "澳門", "CTM"], 35 | "🇰🇿": ["哈萨克斯坦", "哈薩克斯坦", "Kazakhstan"], 36 | "🇱🇦": ["老挝","老挝", "Laos"], 37 | "🇭🇺": ["匈牙利", "Hungary"], 38 | "🇱🇹": ["立陶宛", "Lithuania"], 39 | "🇱🇰": ["斯里兰卡", "斯里蘭卡", "Sri Lanka"], 40 | "🇧🇾": ["BY","白俄罗斯","白俄羅斯", "White Russia", "Republic of Belarus", "Belarus"], 41 | "🇷🇺": ["RU ","RU-", "RU_", "RUS", "Russia", "俄罗斯", "毛子", "俄国", "俄羅斯", "伯力", "莫斯科", "圣彼得堡", "西伯利亚", "新西伯利亚", "京俄", "杭俄","廣俄","滬俄","广俄","沪俄"], 42 | "🇸🇬": ["SG", "Singapore","SINGAPORE", "新加坡", "狮城", "沪新", "京新", "泉新", "穗新", "深新", "杭新", "广新","廣新","滬新"], 43 | "🇺🇸": ["US", "USA", "America", "United States", "美国", "美", "京美", "波特兰", "达拉斯", "俄勒冈", "凤凰城", "费利蒙", "硅谷", "矽谷", "拉斯维加斯", "洛杉矶", "圣何塞", "圣荷西", "圣克拉拉", "西雅图", "芝加哥", "沪美", "哥伦布", "纽约"], 44 | "🇹🇼": ["TW", "Taiwan","TAIWAN", "台湾", "台北", "台中", "新北", "彰化", "CHT", "台", "HINET"], 45 | "🇮🇩": ["ID ", "IDN ", "Indonesia", "印尼", "印度尼西亚", "雅加达"], 46 | "🇮🇪": ["Ireland", "IRELAND", "爱尔兰", "愛爾蘭", "都柏林"], 47 | "🇮🇱": ["Israel", "以色列"], 48 | "🇮🇳": ["India", "IND", "INDIA","印度", "孟买", "Mumbai","IN "], 49 | "🇮🇸": ["IS","ISL", "冰岛","冰島", "Iceland"], 50 | "🇰🇵": ["KP", "朝鲜", "North Korea"], 51 | "🇰🇷": ["KR", "Korea", "KOR", "韩国", "首尔", "韩", "韓","春川"], 52 | "🇬🇭": ["加纳", "Ghana"], 53 | "🇱🇺": ["卢森堡", "Luxembourg"], 54 | "🇱🇻": ["Latvia", "Latvija", "拉脱维亚"], 55 | "🇧🇩": ["孟加拉", "Bengal"], 56 | "🇲🇽️": ["MEX", "MX", "墨西哥", "Mexico", "MEXICO"], 57 | "🇲🇾": ["MY", "Malaysia","MALAYSIA", "马来西亚", "马来", "馬來", "大马", "大馬", "馬來西亞", "吉隆坡"], 58 | "🇳🇱": ["NL", "Netherlands", "荷兰", "荷蘭", "尼德蘭", "阿姆斯特丹"], 59 | "🇵🇭": ["PH", "Philippines", "菲律宾", "菲律賓"], 60 | "🇷🇴": [" RO ", "罗马尼亚", "Rumania"], 61 | "🇸🇦": ["沙特", "利雅得", "Saudi Arabia", "Saudi"], 62 | "🇸🇪": ["SE", "Sweden","瑞典"], 63 | "🇹🇭": ["TH", "Thailand", "泰国", "泰國", "曼谷"], 64 | "🇹🇷": ["TR ","TR-", "TR_", "TUR", "Turkey", "土耳其", "伊斯坦布尔"], 65 | "🇻🇳": ["VN", "越南", "胡志明市", "Vietnam"], 66 | "🇮🇹": ["Italy", " IT ", "Nachash", "意大利", "米兰", "義大利"], 67 | "🇿🇦": ["South Africa", "南非", "Johannesburg"], 68 | "🇦🇪": ["United Arab Emirates", "阿联酋","AE ", "迪拜", "Dubai"], 69 | "🇧🇷": ["BR", "Brazil", "巴西", "圣保罗"], 70 | "🇯🇵": ["JP", "Japan","JAPAN", "日本", "东京", "大阪", "埼玉", "京日", "苏日", "沪日", "穗日", "川日", "中日", "泉日", "杭日", "深日", "辽日", "广日", "Tokyo"], 71 | "🇦🇷": ["AR", "Argentina", "阿根廷"], 72 | "🇳🇴": ["Norway", "挪威", "NO"], 73 | "🇵🇱": [" PL", "POL", "波兰","波蘭", "Poland"], 74 | "🇨🇱": ["智利","Chile","CHILE"], 75 | "🇳🇿": ["新西蘭","新西兰", "New Zealand"], 76 | "🇬🇷": ["希腊","希臘", "Greece"], 77 | "🇪🇬": ["埃及", "Egypt"], 78 | "🇮🇲": ["马恩岛","馬恩島", "Isle of Man", "Mannin"], 79 | "🇵🇹": ["葡萄牙", "Portugal"], 80 | "🇲🇳": ["蒙古", "Mongolia"], 81 | "🇵🇪": ["秘鲁","祕魯", "Peru"], 82 | "🇨🇴": ["哥伦比亚", "Colombia"], 83 | "🇪🇪": ["爱沙尼亚", "Estonia"], 84 | "🇱🇾": ["利比亚","Libya"], 85 | "🇲🇰": ["马其顿","馬其頓", "Macedonia"], 86 | "🇲🇹": ["马耳他", "Malta"], 87 | "🇻🇪": ["委内瑞拉", "Venezuela"], 88 | "🇧🇦": ["波黑共和国","波黑", "Bosnia and Herzegovina"], 89 | "🇬🇪": ["格魯吉亞","格鲁吉亚", "Georgia"], 90 | "🇦🇱": ["阿爾巴尼亞","阿尔巴尼亚", "Albania"], 91 | "🇨🇾": ["CY","塞浦路斯", "Cyprus"], 92 | "🇨🇷": ["哥斯达黎加", "Costa Rica"], 93 | "🇹🇳": ["突尼斯", "Tunisia"], 94 | "🇵🇦": ["巴拿马","巴拿馬", "Panama"], 95 | "🇮🇷": ["伊朗", "Iran"], 96 | "🇯🇴": ["约旦", "約旦", "Jordan"], 97 | "🇺🇾": ["乌拉圭" , "烏拉圭", "Uruguay"], 98 | "🇰🇪": ["肯尼亚", "肯尼亞", "Kenya"], 99 | "🇰🇬": ["吉尔吉斯坦","吉尔吉斯斯坦", "Kyrghyzstan"], 100 | "🇳🇵": ["尼泊尔", "Nepal"], 101 | "🇽🇰": ["科索沃", "Kosovo"], 102 | "🇲🇦": ["摩洛哥", "Morocco"], 103 | "🇪🇨": ["厄瓜多尔","EC", "Ecuador"], 104 | "🇲🇺": ["毛里求斯", "Mauritius"], 105 | "🇵🇷": ["波多黎各", "PR", "Puerto Rico"], 106 | "🇭🇰": ["HK", "Hongkong", "Hong Kong", "HongKong", "HONG KONG","香港", "深港", "沪港", "呼港", "HKT", "HKBN", "HGC", "WTT", "CMI", "穗港", "京港", "港"], 107 | "🇨🇳": ["CN", "China", "回国", "中国","中國", "江苏", "北京", "上海", "广州", "深圳", "杭州", "徐州", "青岛", "宁波", "镇江", "back"], 108 | "🇱🇧": ["黎巴嫩","LB", "Lebanon"], 109 | "🇧🇳": ["文莱","BRN","Negara Brunei Darussalam"], 110 | "🌏": ["亚洲","Asia"] 111 | } -------------------------------------------------------------------------------- /Scripts/traffic-check.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | For Quantumult-X 631+ ONLY!! 4 | 5 | [task_local] 6 | 7 | event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/traffic-check.js, tag=策略流量查询, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Download.png, enabled=true 8 | 9 | ps. 简单查询策略/策略组流量使用统计(仅支持一/二级策略) 10 | 11 | @XIAO_KOP 12 | 13 | **/ 14 | 15 | const messageTraffic = { 16 | action: "get_traffic_statistics" 17 | }; 18 | 19 | let version = Number($environment.version.split("build")[1]) 20 | 21 | let result = { 22 | "title" : "策略流量查詢" 23 | } 24 | 25 | var policy = $environment.params 26 | const message = { 27 | action: "get_customized_policy", 28 | content: policy 29 | 30 | }; 31 | 32 | let [datad, datau]= [0, 0] //总下载/上传流量 33 | var checked = [] // 已经检查的节点名单 34 | var checkedtraffic = [] //已检查节点的总用量 35 | 36 | var pflag=1 //是否是策略,或者简单节点 37 | 38 | //策略组 or 节点 39 | $configuration.sendMessage(message).then(resolve => { 40 | if (resolve.error) { 41 | console.log(resolve.error); 42 | $done() 43 | } 44 | if (resolve.ret) { 45 | output=JSON.stringify(resolve.ret[message.content])? JSON.parse(JSON.stringify(resolve.ret[message.content]["candidates"])) : [$environment.params] 46 | pflag = JSON.stringify(resolve.ret[message.content])? pflag:0 47 | console.log("节点or策略组:"+pflag) 48 | if (version >=631) { 49 | console.log("Build "+version) 50 | DisplayNodeTraffic(output,pflag) 51 | } else { 52 | console.log("Build "+version) 53 | $done({"title":result["title"],"message":"🚫 你的 APP 版本不支持使用此脚本\n\n💡 需要版本 1.0.28(631+)"}) 54 | } 55 | 56 | } 57 | //$done();| 58 | }, reject => { 59 | // Normally will never happen. 60 | $done(); 61 | }); 62 | 63 | function getJsonLength(jsonData){ 64 | var jsonLength = 0; 65 | for(var item in jsonData){ 66 | jsonLength++; 67 | } 68 | return jsonLength; 69 | } 70 | 71 | 72 | // 计算流量信息 73 | var [Tdatad,Tdatau,Udatad,Udatau]=[0,0,0,0] 74 | var total = 0 75 | var gdnode = 0 76 | var gdname = policy 77 | 78 | function getServerTraffic(data,nodes){ 79 | //console.log(data.name) 80 | let type = data.type 81 | let nname = data.name 82 | //console.log("下载用量:"+(data.rx_transfer/1024/1024).toFixed(1)+"MB") 83 | if (nodes.indexOf(nname) != -1) { 84 | if (type == "tcp") { 85 | //console.log(typeof(Tdatad),typeof(Tdatau)) 86 | Tdatad=(Number(Tdatad)+data.rx_transfer/1024/1024) 87 | Tdatau=(Number(Tdatau)+data.tx_transfer/1024/1024) 88 | //console.log(Tdatad,Tdatau) 89 | } else if (type == "udp") { 90 | Udatad=(Number(Udatad)+data.rx_transfer/1024/1024) 91 | Udatau=(Number(Udatau)+data.tx_transfer/1024/1024) 92 | } 93 | let total = (data.rx_transfer+data.tx_transfer)/1024/1024 94 | if (checked.indexOf(nname)==-1) { 95 | checked.push(nname) 96 | checkedtraffic.push(total) 97 | } else { 98 | checkedtraffic[checked.indexOf(nname)]=checkedtraffic[checked.indexOf(nname)]+total 99 | } 100 | } else { 101 | } 102 | } 103 | 104 | //流量排序 105 | function Rank(){ 106 | console.log(checked) 107 | console.log(checkedtraffic) 108 | checked.sort((prev,next)=> { 109 | return checkedtraffic[checked.indexOf(next)]-checkedtraffic[checked.indexOf(prev)] 110 | }) 111 | checkedtraffic.sort((prev,next)=> { 112 | return next-prev 113 | }) 114 | console.log(checkedtraffic.map(item => item.toFixed(1))) 115 | let rst = checked.map((name, i) => ([i+1,name,CUnit(checkedtraffic[i])].join(": "))) 116 | console.log(rst.join("\n")) 117 | let msg = "" 118 | if (checked.length>=3) { 119 | msg = "🥇 "+checked[0]+" ☞ "+CUnit(checkedtraffic[0])+"🥈 "+checked[1]+" ☞ "+CUnit(checkedtraffic[1])+"🥉 "+checked[2]+" ☞ "+CUnit(checkedtraffic[2]) 120 | } else if (checked.length==2) { 121 | msg = "🥇 "+checked[0]+" ☞ "+CUnit(checkedtraffic[0])+"🥈 "+checked[1]+" ☞ "+CUnit(checkedtraffic[1]) 122 | } else if (checked.length==1) { 123 | msg = "🥇 "+checked[0]+" ☞ "+CUnit(checkedtraffic[0]) 124 | } 125 | //msg = `` + msg + `
` 126 | msg = msg!=""? ""+msg+"" :" 无使用节点流量记录" 127 | return msg 128 | } 129 | 130 | //查询流量 131 | function DisplayNodeTraffic(nodes,pflag) { 132 | $configuration.sendMessage(messageTraffic).then(resolve => { 133 | if (resolve.error) { 134 | console.log(resolve.error); 135 | } 136 | if (resolve.ret) { 137 | let output=JSON.stringify(resolve.ret, null, 2); 138 | let len = getJsonLength(resolve.ret) 139 | for (var item in resolve.ret) { 140 | getServerTraffic(resolve.ret[item],nodes) 141 | } 142 | //console.log(output); 143 | content = NodeData(nodes,pflag); 144 | //console.log(content) 145 | $done({"title":result["title"],"htmlMessage":content}) 146 | } 147 | $done(); 148 | }, reject => { 149 | // Normally not gonna happen. 150 | $done(); 151 | }); 152 | } 153 | 154 | //单位展示 155 | function CUnit(cnt) { 156 | cnt = Number(cnt)>=1024? (cnt/1024).toFixed(2)+" GB " : cnt.toFixed(1)+" MB " 157 | return cnt 158 | } 159 | 160 | function NodeData(nodes,pflag){ 161 | datad = "TCP : "+" "+CUnit(Tdatad)+"⟱ | "+CUnit(Tdatau)+"⟰ " 162 | datau = "UDP : "+" "+CUnit(Udatad)+"⟱ | "+CUnit(Udatau)+"⟰ " 163 | total = CUnit(Tdatad+Tdatau+Udatad+Udatau) 164 | Ncontent = "--------------------------------------"+[datad,datau].join("")+ "--------------------------------------" 165 | Ncontent = pflag == 0? Ncontent+""+"节点 ➟ " + policy+ " ☞ "+total+" 流量 " : ""+" 策略 ➟ " + policy+ " 共 『"+checked.length+"/"+nodes.length+"』 个节点 ☞ "+total+" 流量 "+Ncontent+" 🏆 排行榜 " 166 | Ncontent = pflag == 0? Ncontent : Ncontent +Rank() 167 | Ncontent = `` + Ncontent + `
` 168 | //console.log(Ncontent) 169 | return Ncontent 170 | } 171 | 172 | -------------------------------------------------------------------------------- /Scripts/nf_ytb_ui-check.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | Thanks to & modified from https://gist.githubusercontent.com/Hyseen/b06e911a41036ebc36acf04ddebe7b9a/raw/nf_check.js 4 | 5 | For Quantumult-X 598 6 | 7 | 2022-12-16 8 | 9 | [task_local] 10 | 11 | event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/nf_ytb_ui-check.js, tag=YouTube/Netflix 解锁查询, img-url=checkmark.seal.system, enabled=true 12 | 13 | 14 | 15 | @XIAO_KOP 16 | 17 | **/ 18 | 19 | 20 | const BASE_URL = 'https://www.netflix.com/title/' 21 | const BASE_URL_YTB = "https://www.youtube.com/premium" 22 | 23 | const FILM_ID = 80062035 24 | const link = { "media-url": "https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/img/southpark/7.png" } 25 | const policy_name = "Netflix" //填入你的 netflix 策略组名 26 | 27 | const arrow = "➟" 28 | var output = "" 29 | var opts = { 30 | policy: $environment.params 31 | }; 32 | 33 | 34 | var flags = new Map([[ "AC" , "🇦🇨" ] ,["AE","🇦🇪"], [ "AF" , "🇦🇫" ] , [ "AI" , "🇦🇮" ] , [ "AL" , "🇦🇱" ] , [ "AM" , "🇦🇲" ] , [ "AQ" , "🇦🇶" ] , [ "AR" , "🇦🇷" ] , [ "AS" , "🇦🇸" ] , [ "AT" , "🇦🇹" ] , [ "AU" , "🇦🇺" ] , [ "AW" , "🇦🇼" ] , [ "AX" , "🇦🇽" ] , [ "AZ" , "🇦🇿" ] , ["BA", "🇧🇦"], [ "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" , "🇿🇦"]]) 35 | 36 | 37 | !(async () => { 38 | let result = { 39 | title: '📺 Netflix/YouTube 解锁查询', 40 | content: '----------------------\n\n检测失败,请重试', 41 | content1: '检测失败,请重试' 42 | } 43 | 44 | await Promise.race([test(FILM_ID),timeOut(5000)]) 45 | .then((code) => { 46 | console.log(code) 47 | 48 | if (code === 'Not Available') { 49 | result['content'] = '----------------------\n\n🛑 未支持 Netflix' 50 | //return 51 | //console.log(result) 52 | } else if (code === 'Not Found') { 53 | result['content'] = '----------------------\n\n⚠️ 仅支持 Netflix 自制剧' 54 | //return 55 | } else if (code === "timeout") { 56 | result['content'] = "----------------------\n\n🛑 测试超时" 57 | } else { 58 | result['content'] = '----------------------\n\n✅ 完整支持 Netflix ➟ ⟦'+flags.get(code.toUpperCase())+code.toUpperCase()+"⟧" 59 | } 60 | 61 | return testYTB() 62 | // $notify(result["title"], output, result["content"]+"\n"+result["content1"], link) 63 | // $done({"title":result["title"],"message":result["content"]+"\n"+result["content1"]}) 64 | }) 65 | .then((code) => { 66 | 67 | console.log(code) 68 | if (code === 'Not Available') { 69 | result['content1'] = '⚠️ 未支持 YouTube Premium' 70 | //return 71 | } else if (code === "timeout") { 72 | result['content1'] = "🛑 测试超时" 73 | } else { 74 | result['content1'] = "✅ 支持 YouTube Premium ➟ ⟦"+flags.get(code.toUpperCase())+code.toUpperCase()+"⟧" 75 | } 76 | $done({"title":result["title"],"message":result["content"]+"\n\n"+result["content1"]+'\n\n----------------------\n'+$environment.params}) 77 | 78 | }) 79 | // ) 80 | })() 81 | .finally(() => $done()); 82 | 83 | function timeOut(delay) { 84 | return new Promise((resolve, reject) => { 85 | setTimeout(() => { 86 | //reject(new Error('timeout')) 87 | resolve("timeout") 88 | }, delay) 89 | }) 90 | } 91 | 92 | 93 | function test(filmId) { 94 | return new Promise((resolve, reject) => { 95 | let option = { 96 | url: BASE_URL + filmId, 97 | opts: opts, 98 | timeout: 4000, 99 | headers: { 100 | 'User-Agent': 101 | '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', 102 | }, 103 | } 104 | $task.fetch(option).then (response => { 105 | console.log(response.statusCode) 106 | if (response.statusCode === 404) { 107 | resolve('Not Found') 108 | return 109 | } 110 | 111 | if (response.statusCode === 403) { 112 | resolve('Not Available') 113 | return 114 | } 115 | 116 | if (response.statusCode === 200) { 117 | let url = response.headers['X-Originating-URL'] 118 | let region = url.split('/')[3] 119 | region = region.split('-')[0] 120 | if (region == 'title') { 121 | region = 'us' 122 | } 123 | resolve(region) 124 | return 125 | } 126 | reject('Error') 127 | }, reason => { 128 | resolve("timeout") 129 | return 130 | } 131 | ) 132 | }) 133 | } 134 | 135 | function testYTB() { 136 | return new Promise((resolve, reject) => { 137 | let option = { 138 | url: BASE_URL_YTB, 139 | opts: opts, 140 | timeout: 4000, 141 | headers: { 142 | 'User-Agent': 143 | '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' 144 | }, 145 | } 146 | $task.fetch(option).then(response=> { 147 | let data = response.body 148 | console.log(response.statusCode) 149 | if (response.statusCode !== 200) { 150 | reject('Error') 151 | return 152 | } 153 | 154 | if (data.indexOf('Premium is not available in your country') !== -1) { 155 | resolve('Not Available') 156 | return 157 | } 158 | //console.log(data.split("countryCode")[1]) 159 | let region = '' 160 | let re = new RegExp('"GL":"(.*?)"', 'gm') 161 | let result = re.exec(data) 162 | if (result != null && result.length === 2) { 163 | region = result[1] 164 | } else if (data.indexOf('www.google.cn') !== -1) { 165 | region = 'CN' 166 | } else { 167 | region = 'US' 168 | } 169 | resolve(region) 170 | }, reason => { 171 | resolve("timeout") 172 | }) 173 | }) 174 | } 175 | -------------------------------------------------------------------------------- /Scripts/TaskGallery.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"HotKids", 3 | "description":"Crontab Task Gallery", 4 | "task":[ 5 | {"config":"0 12 * * 1 https://raw.githubusercontent.com/Peng-YM/QuanX/master/Tasks/epic.js, tag=cookie重写, img-url=https://raw.githubusercontent.com/crossutility/Quantumult-X/master/quantumult-x.png","addons":"https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/GetCookie.conf"}, 6 | "0 12 * * 1 https://raw.githubusercontent.com/Peng-YM/QuanX/master/Tasks/epic.js, tag=每周 Epic 游戏限免, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/epic.png", 7 | "0 9 * * * https://raw.githubusercontent.com/evilbutcher/Quantumult_X/master/check_in/idaily/idaily.js, tag=iDaily·每日环球视野, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/iDaily.png", 8 | "0 9 * * * https://raw.githubusercontent.com/zZPiglet/Task/master/MovieCalendar/MovieCalendar.js, tag=豆瓣·电影日历, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/douban.png", 9 | "0 10 * * * https://raw.githubusercontent.com/Peng-YM/QuanX/master/Tasks/exchange.js, tag=每日汇率, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/exchange.png", 10 | "30 23 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/10010/unicom_checkin.js, tag=中国联通, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/10010.png", 11 | "50 23 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/didichuxing/didi_checkin.js, tag=滴滴出行, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/didi.png", 12 | "0 9 * * * https://raw.githubusercontent.com/HotKids/Rules/master/Script/xiami.js, tag=虾米音乐, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/xiami.png", 13 | "0 6 * * * https://raw.githubusercontent.com/lowking/Scripts/master/sony/sonyClub.js, tag=My SONY Club, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/sony.png", 14 | "0 6 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.js, tag=WPS, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/wps.png", 15 | "0 7 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/famijia/famijia_checkin.js, tag=全家, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/famijia.png", 16 | "0 1,6 * * * https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js, tag=京东, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/jd.png", 17 | "10 6 * * 1 https://gitee.com/lxk0301/scripts/raw/master/jd_unsubscribe.js, tag=取关京东店铺及商品, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/jd.png", 18 | "30 9 * * * https://raw.githubusercontent.com/toulanboy/scripts/master/jd_price_detect/jd_price_detect.js, tag=京东价格提醒, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/jd.png", 19 | "30 9 * * * https://raw.githubusercontent.com/id77/QuantumultX/master/task/jdWuLiu.js, tag=京东派件提醒, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/jd.png", 20 | "30 9 * * * https://gitee.com/lxk0301/scripts/raw/master/jd_bean_change.js, tag=京豆变动通知, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/jd.png", 21 | "0 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/suning/suning.js, tag=苏宁易购, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/suning.png", 22 | "1 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/meituan/meituan.js, tag=美团, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/meituan.png", 23 | "2 5 * * * https://raw.githubusercontent.com/zZPiglet/Task/master/elem/elemCheckIn.js, tag=饿了么, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/ele.png", 24 | "3 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/jddj/jddj.js, tag=京东到家, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/jddj.png", 25 | "4 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/mcdd/mcdd.js, tag=叮咚买菜, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/ddmc.png", 26 | "4 5 * * * https://raw.githubusercontent.com/iepngs/Script/master/dingdong/index.js, tag=叮咚农场, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/ddmc.png", 27 | "5 5 * * * https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js, tag=爱奇艺, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/iqiyi.png", 28 | "6 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/videoqq/videoqq.js, tag=腾讯视频, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/tencentvideo.png", 29 | "7 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/mgtv/mgtv.js, tag=芒果 TV, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/mgtv.png", 30 | "8 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/bilibili/bilibili.js, tag=哔哩哔哩, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/bilibili.png", 31 | "8 5 * * 1 https://raw.githubusercontent.com/chavyleung/scripts/master/bilibili/bilibili.silver2coin.js, tag=B站银瓜子转硬币, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/bilibiliblue.png", 32 | "9 5 * * * https://raw.githubusercontent.com/NobyDa/Script/master/Bilibili-DailyBonus/Manga.js, tag=哔哩哔哩漫画, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/bilibilimanga.png", 33 | "10 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/quanx/neteasemusic.js, tag=网易云音乐, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/neteasemusic.png", 34 | "11 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.js, tag=喜马拉雅, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/himalaya.png", 35 | "12 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/zimuzu/zimuzu.js, tag=人人字幕组, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/zimuzu.png", 36 | "13 5 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/smzdm/smzdm_checkin.js, tag=什么值得买, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/smzdm.png", 37 | "13 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/smzdm/quanx/smzdm.js, tag=什么值得买, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/smzdm.png", 38 | "14 5 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/manmanbuy/manmanbuy_checkin.js, tag=慢慢买, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/manmanbuy.png", 39 | "15 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/sfexpress/sfexpress.js, tag=顺丰速运, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/sfexpress.png", 40 | "16 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/duokan/duokan.js, tag=多看阅读, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/duokan.png", 41 | "17 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/dbsj/dbsj.js, tag=豆瓣时间, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/douban.png", 42 | "18 5 * * * https://raw.githubusercontent.com/zZPiglet/Task/master/Haidilao/Haidilao.js, tag=海底捞, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/hdl.png", 43 | "19 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/pagoda/pagoda.js, tag=百果园, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/pagoda.png", 44 | "20 5 * * * https://raw.githubusercontent.com/zZPiglet/Task/master/Blibee/Blibee.js, tag=便利蜂, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/Blibee.png", 45 | "21 5 * * * https://raw.githubusercontent.com/zZPiglet/Task/master/umetrip/umetrip.js,tag=航旅纵横, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/UmeTrip.png", 46 | "22 5 * * * https://raw.githubusercontent.com/barrym-chen/Script/master/ctrip/ctrip.js, tag=携程 App, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/ctrip.png", 47 | "22 5 * * * https://raw.githubusercontent.com/barrym-chen/Script/master/ctrip_wx/ct_sign.js, tag=携程 小程序, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/ctrip.png", 48 | "23 5 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/hellobike/hellobike.js, tag=哈啰出行, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/hellobike.png", 49 | "24 5 * * * https://ooxx.be/js/jegotrip.js, tag=无忧行, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/JegoTrip.png", 50 | "25 5 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/flyertea/flyertea.js, tag=飞客茶馆, img-url=https://raw.githubusercontent.com/HotKids/Rules/master/Quantumult/X/Images/Task/flyertea.png" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /Scripts/switch-check-ytb.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | For Quantumult-X 598+ ONLY!! 4 | 5 | [task_local] 6 | 7 | // UI 查询版本 8 | event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-ytb.js, tag=YouTube 切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/YouTube_Letter.png, enabled=true 9 | 10 | // cron task 版本 11 | 0 8 * * * https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-ytb.js#policy=你的策略组, tag=YouTube 定时切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/YouTube_Letter.png, enabled=true 12 | 13 | ps. 简单粗暴的 UI-Interaction 版本。无数据持久化、粗暴延迟等待。完美主义建议使用 Helge大佬的boxjs版本 https://t.me/QuanXNews/193 14 | 15 | @XIAO_KOP 16 | 17 | 2022-07-04 18 | 19 | **/ 20 | 21 | const BASE_URL = 'https://www.youtube.com/premium' 22 | 23 | const link = { "media-url": "https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/img/southpark/7.png" } 24 | var cronsign = $environment.executeType == 0 || $environment.executeType == "0" || $environment.executeType == "-1"? "Y" : "N" 25 | var policy = $environment.executeType == 0 || $environment.executeType == "0" || $environment.executeType == "-1"? GetPolicy($environment.sourcePath) : $environment.params 26 | console.log(JSON.stringify($environment)) 27 | console.log("策略组:"+policy) 28 | 29 | function GetPolicy(cnt) { 30 | if (cnt && cnt.indexOf("#policy=") !=-1) { 31 | return decodeURIComponent(cnt.split("#policy=")[1].trim()) 32 | }else { 33 | return "" 34 | } 35 | } 36 | 37 | const message = { 38 | action: "get_customized_policy", 39 | content: policy 40 | 41 | }; 42 | 43 | var output=[] 44 | var OKList=[] 45 | var NoList=["不支持节点 ➟ "] 46 | var ErrorList=["检测出错节点 ➟ "] 47 | var pflag=1 //是否是策略,或者简单节点 48 | var sign=0 49 | 50 | $configuration.sendMessage(message).then(resolve => { 51 | if (resolve.error) { 52 | console.log(resolve.error); 53 | $done() 54 | } 55 | if (resolve.ret) { 56 | //$notify(JSON.stringify(resolve.ret)) 57 | output=JSON.stringify(resolve.ret[message.content])? JSON.parse(JSON.stringify(resolve.ret[message.content]["candidates"])) : [policy] 58 | pflag = JSON.stringify(resolve.ret[message.content])? pflag:0 59 | console.log("YouTube Premium 检测") 60 | console.log("节点or策略组:"+pflag) 61 | if (pflag==1) { 62 | console.log("节点数量:"+resolve.ret[policy]["candidates"].length) 63 | if(resolve.ret[policy]["candidates"].length==0) { 64 | $done({"title":"YouTube Premium 检测","htmlMessage":`
😭 无有效节点`});
65 | }
66 | }
67 |
68 | //$notify(typeof(output),output)
69 | Check()
70 | //$done({"title":"策略内容","message":output})
71 | }
72 | //$done();|
73 | }, reject => {
74 | // Normally will never happen.
75 | $done();
76 | });
77 |
78 | function Len(cnt) {
79 | return cnt.length-1
80 | }
81 |
82 | function Check() {
83 | var relay = 2000;
84 | for ( var i=0;i < output.length;i++) {
85 | testYTB(output[i])
86 | }
87 | if (output.length<=5) {
88 | relay = 2000
89 | } else if (output.length<10) {
90 | relay =4000
91 | } else if (output.length<15) {
92 | relay =6000
93 | } else if (output.length<20) {
94 | relay =8000
95 | } else {
96 | relay =10000
97 | }
98 | console.log(output.length+":"+relay)
99 | setTimeout(() => {
100 | console.log("⛳️ 共计 "+OKList.length+" 个:支持节点 ➟ "+ OKList)
101 | console.log("🏠 共计 "+Len(NoList)+" 个:"+NoList)
102 | console.log("🕹 共计 "+Len(ErrorList)+" 个:"+ErrorList)
103 | sign = 1
104 | if (OKList[0] && pflag==1) { //有支持节点、且为策略组才操作
105 | console.log("开始排序")
106 | ReOrder(OKList)
107 | } else if (!OKList[0]){ //不支持
108 | content =pflag==0 ? `
😭 该节点不支持 YouTube Premium
👇
-------------------------
⟦ `+policy+` ⟧
-------------------------`: `
` + "
❌ ⟦ "+policy+ " ⟧ ⚠️ 切换失败
该策略组内未找到支持 YouTube Premium 的节点" + "
-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`
🎉 该节点支持 YouTube Premium
👇
-------------------------
⟦ `+policy+` ⟧
-------------------------`
112 | $done({"title":"YouTube Premium 检测&切换", "htmlMessage": content})
113 | }
114 | }, relay)
115 |
116 | }
117 |
118 | //选择最优延迟节点
119 | function ReOrder(cnt) {
120 | const array = cnt;
121 | const messageURL = {
122 | action: "url_latency_benchmark",
123 | content: array
124 | };
125 | $configuration.sendMessage(messageURL).then(resolve => {
126 | if (resolve.error) {
127 | console.log(resolve.error);
128 | }
129 | if (resolve.ret) {
130 | let output=JSON.stringify(resolve.ret);
131 | console.log("节点延迟:"+output);
132 | //排序
133 | console.log("排序前: "+ array)
134 | if(array){
135 | try {
136 | array.sort(function (a,b) {
137 | //console.log(a+" VS "+b)
138 | return (resolve.ret[a][1]!=-1 && resolve.ret[b][1] !=-1)? resolve.ret[a][1]-resolve.ret[b][1] : resolve.ret[b][1]
139 | })
140 | } catch (err) {
141 | console.log(err)
142 | }
143 | }
144 | console.log("排序后: "+array)
145 | let Ping =resolve.ret[array[0]]
146 | const dict = { [policy] : array[0]};
147 | if(array[0]) {
148 | console.log("选定支持YouTube Premium:"+array[0]+"延迟数据为 👉"+Ping)
149 | Ping = " ⚡️ 节点延迟 ➟ 「 "+Ping + " 」 "
150 | }
151 | const mes1 = {
152 | action: "set_policy_state",
153 | content: dict
154 | };
155 | $configuration.sendMessage(mes1).then(resolve => {
156 | if (resolve.error) {
157 | console.log(resolve.error);
158 | content =pflag==0 && array[0]? `
` + "
⟦ "+policy+ " ⟧
🎉 该节点支持 YouTube Premium" + `
` + "
⟦ "+policy+ " ⟧
⚠️ 该节点不支持 YouTube Premium" + `
` + "
❌ ⟦ "+policy+ " ⟧ ⚠️ 切换失败
该策略组内未找到支持 YouTube Premium 的节点" + "
-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`
` + "
⟦ "+policy+ " ⟧ 已切换至支持Premium 的路线中延迟最优节点
👇
⟦ "+array[0]+ " ⟧" + "
"+Ping+"
-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`
` +'----------------------'+result["status"]+'----------------------'+$environment.params + `
` 61 | $done({"title":result["title"],"htmlMessage":cnt}) 62 | })() 63 | .finally(() => $done({"title":result["title"],"htmlMessage":``+'----------------------'+result["status"]+'----------------------'+$environment.params + `
`})); 64 | 65 | 66 | async function testDisneyPlus() { 67 | try { 68 | let { region, cnbl } = await Promise.race([testHomePage(), timeout(7000)]) 69 | console.log(`homepage: region=${region}, cnbl=${cnbl}`) 70 | // 即将登陆 71 | // if (cnbl == 2) { 72 | // return { region, status: STATUS_COMING } 73 | // } 74 | let { countryCode, inSupportedLocation, accessToken } = await Promise.race([getLocationInfo(), timeout(7000)]) 75 | console.log(`getLocationInfo: countryCode=${countryCode}, inSupportedLocation=${inSupportedLocation}`) 76 | 77 | region = countryCode ?? region 78 | console.log( "region:"+region) 79 | // 即将登陆 80 | if (inSupportedLocation === false || inSupportedLocation === 'false') { 81 | return { region, status: STATUS_COMING } 82 | } else { 83 | // 支持解锁 84 | return { region, status: STATUS_AVAILABLE } 85 | } 86 | 87 | let support = await Promise.race([testPublicGraphqlAPI(accessToken), timeout(7000)]) 88 | if (!support) { 89 | return { status: STATUS_NOT_AVAILABLE } 90 | } 91 | // 支持解锁 92 | return { region, status: STATUS_AVAILABLE } 93 | 94 | } catch (error) { 95 | console.log("error:"+error) 96 | 97 | // 不支持解锁 98 | if (error === 'Not Available') { 99 | console.log("不支持") 100 | return { status: STATUS_NOT_AVAILABLE } 101 | } 102 | 103 | // 检测超时 104 | if (error === 'Timeout') { 105 | return { status: STATUS_TIMEOUT } 106 | } 107 | 108 | return { status: STATUS_ERROR } 109 | } 110 | 111 | } 112 | 113 | function getLocationInfo() { 114 | return new Promise((resolve, reject) => { 115 | let opts0 = { 116 | url: 'https://disney.api.edge.bamgrid.com/graph/v1/device/graphql', 117 | method: "POST", 118 | opts: opts, 119 | headers: { 120 | 'Accept-Language': 'en', 121 | "Authorization": 'ZGlzbmV5JmJyb3dzZXImMS4wLjA.Cu56AgSfBTDag5NiRA81oLHkDZfu5L3CKadnefEAY84', 122 | 'Content-Type': 'application/json', 123 | 'User-Agent': UA, 124 | }, 125 | body: JSON.stringify({ 126 | query: 'mutation registerDevice($input: RegisterDeviceInput!) { registerDevice(registerDevice: $input) { grant { grantType assertion } } }', 127 | variables: { 128 | input: { 129 | applicationRuntime: 'chrome', 130 | attributes: { 131 | browserName: 'chrome', 132 | browserVersion: '94.0.4606', 133 | manufacturer: 'apple', 134 | model: null, 135 | operatingSystem: 'macintosh', 136 | operatingSystemVersion: '10.15.7', 137 | osDeviceIds: [], 138 | }, 139 | deviceFamily: 'browser', 140 | deviceLanguage: 'en', 141 | deviceProfile: 'macosx', 142 | }, 143 | }, 144 | }), 145 | } 146 | 147 | $task.fetch(opts0).then(response => { 148 | let data = response.body 149 | console.log("locationinfo:"+response.statusCode) 150 | if (response.statusCode !== 200) { 151 | console.log('getLocationInfo: ' + data) 152 | reject('Not Available') 153 | return 154 | } else { 155 | let { 156 | token: { accessToken }, 157 | session: { 158 | inSupportedLocation, 159 | location: { countryCode }, 160 | }, 161 | } = JSON.parse(data)?.extensions?.sdk 162 | resolve({ inSupportedLocation, countryCode, accessToken }) 163 | } 164 | }, reason => { 165 | reject('Error') 166 | return 167 | }) 168 | }) 169 | } 170 | 171 | function testPublicGraphqlAPI(accessToken) { 172 | return new Promise((resolve, reject) => { 173 | let opts = { 174 | url: 'https://disney.api.edge.bamgrid.com/v1/public/graphql', 175 | headers: { 176 | 'Accept-Language': 'en', 177 | Authorization: accessToken, 178 | 'Content-Type': 'application/json', 179 | 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36', 180 | }, 181 | body: JSON.stringify({ 182 | query: 183 | 'query($preferredLanguages: [String!]!, $version: String) {globalization(version: $version) { uiLanguage(preferredLanguages: $preferredLanguages) }}', 184 | variables: { version: '1.5.0', preferredLanguages: ['en'] }, 185 | }), 186 | } 187 | 188 | $task.fetch(opts).then( response => { 189 | 190 | resolve(response.status === 200) 191 | }, reason => { 192 | reject('Error') 193 | return 194 | }) 195 | }) 196 | } 197 | 198 | function testHomePage() { 199 | return new Promise((resolve, reject) => { 200 | let opts0 = { 201 | url: 'https://www.disneyplus.com/', 202 | opts: opts, 203 | headers: { 204 | 'Accept-Language': 'en', 205 | 'User-Agent': UA, 206 | }, 207 | } 208 | $task.fetch(opts0).then(response => { 209 | let data = response.body 210 | //console.log("homepage"+response.statusCode) 211 | if (response.statusCode !== 200 || data.indexOf('not available in your') !== -1) { 212 | reject('Not Available') 213 | return 214 | } else { 215 | let match = data.match(/Region: ([A-Za-z]{2})[\s\S]*?CNBL: ([12])/) 216 | if (!match) { 217 | resolve({ region: '', cnbl: '' }) 218 | return 219 | } else { 220 | let region = match[1] 221 | let cnbl = match[2] 222 | //console.log("homepage"+region+cnbl) 223 | resolve({ region, cnbl }) 224 | } 225 | } 226 | }, reason => { 227 | reject('Error') 228 | return 229 | }) 230 | }) 231 | } 232 | 233 | function timeout(delay = 5000) { 234 | return new Promise((resolve, reject) => { 235 | setTimeout(() => { 236 | reject('Timeout') 237 | }, delay) 238 | }) 239 | } 240 | 241 | var flags = new Map([[ "AC" , "🇦🇨" ] ,["AE","🇦🇪"], [ "AF" , "🇦🇫" ] , [ "AI" , "🇦🇮" ] , [ "AL" , "🇦🇱" ] , [ "AM" , "🇦🇲" ] , [ "AQ" , "🇦🇶" ] , [ "AR" , "🇦🇷" ] , [ "AS" , "🇦🇸" ] , [ "AT" , "🇦🇹" ] , [ "AU" , "🇦🇺" ] , [ "AW" , "🇦🇼" ] , [ "AX" , "🇦🇽" ] , [ "AZ" , "🇦🇿" ] , ["BA", "🇧🇦"], [ "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" , "🇿🇦"]]) 242 | -------------------------------------------------------------------------------- /Scripts/switch-check-google.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | For Quantumult-X 598+ ONLY!! 4 | 5 | [task_local] 6 | 7 | // UI 入口切换版本 8 | event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-google.js, tag=Google Sifter, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Google_Search.png, enabled=true 9 | 10 | // Cron 定时切换版本 11 | 0 8 * * * https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-google.js#policy=你的策略组名, tag=Google 送中定时切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Google_Search.png, enabled=true 12 | 13 | 14 | ps. 简单粗暴的 UI-Interaction 版本。无数据持久化、粗暴延迟等待。完美主义建议使用 Helge大佬的boxjs版本 https://t.me/QuanXNews/193 15 | 16 | @XIAO_KOP 17 | 18 | **/ 19 | 20 | //var policy = $environment.params 21 | var cronsign = $environment.executeType == 0 || $environment.executeType == "0" || $environment.executeType == "-1"? "Y" : "N" 22 | var policy = $environment.executeType == 0 || $environment.executeType == "0" || $environment.executeType == "-1"? GetPolicy($environment.sourcePath) : $environment.params 23 | console.log(JSON.stringify($environment)) 24 | console.log("策略组:"+policy) 25 | 26 | function GetPolicy(cnt) { 27 | if (cnt && cnt.indexOf("#policy=") !=-1) { 28 | return decodeURIComponent(cnt.split("#policy=")[1].trim()) 29 | }else { 30 | return "" 31 | } 32 | } 33 | 34 | const message = { 35 | action: "get_customized_policy", 36 | content: policy 37 | 38 | }; 39 | 40 | var output=[] 41 | var OKList=[] 42 | var NoList=["已被送中节点 ➟ "] 43 | var ErrorList=["检测出错节点 ➟ "] 44 | var pflag=1 //是否是策略,或者简单节点 45 | var sign=0 //是否停止 46 | 47 | $configuration.sendMessage(message).then(resolve => { 48 | if (resolve.error) { 49 | console.log(resolve.error); 50 | $done() 51 | } 52 | if (resolve.ret) { 53 | //console.log(JSON.stringify(resolve.ret)) 54 | output=JSON.stringify(resolve.ret[message.content])? JSON.parse(JSON.stringify(resolve.ret[message.content]["candidates"])) : [policy] 55 | pflag = JSON.stringify(resolve.ret[message.content])? pflag:0 56 | console.log("Google 送中检测 检测") 57 | console.log("节点or策略组:"+pflag) 58 | 59 | if (pflag==1) { 60 | console.log("节点数量:"+resolve.ret[policy]["candidates"].length) 61 | 62 | if(resolve.ret[policy]["candidates"].length==0) { 63 | $done({"title":"Google 送中检测","htmlMessage":`
😭 无有效节点`});
64 | }
65 | }
66 |
67 | //$notify(typeof(output),output)
68 | Check()
69 | //$done({"title":"策略内容","message":output})
70 | }
71 | }, reject => {
72 | // Normally will never happen.
73 | $done();
74 | });
75 |
76 | function Len(cnt) {
77 | return cnt.length-1
78 | }
79 |
80 | function Check() {
81 | var relay = 2000;
82 | for ( var i=0;i < output.length;i++) {
83 | testGoogle(output[i])
84 | }
85 | if (output.length<=5) {
86 | relay = 2000
87 | } else if (output.length<10) {
88 | relay =4000
89 | } else if (output.length<15) {
90 | relay =6000
91 | } else if (output.length<20) {
92 | relay =8000
93 | } else {
94 | relay =10000
95 | }
96 | console.log(output.length+":"+relay)
97 | setTimeout(() => {
98 | console.log("⛳️ 共计 "+OKList.length+" 个:未送中节点 ➟ "+ OKList)
99 | console.log("🏠 共计 "+Len(NoList)+" 个:"+NoList)
100 | console.log("🕹 共计 "+Len(ErrorList)+" 个:"+ErrorList)
101 | sign=1
102 | if (OKList[0] && pflag==1) { //有支持节点、且为策略组才操作
103 | ReOrder(OKList)
104 | } else if (!OKList[0]){ //不支持
105 | content =pflag==0 ? `
😭 该节点已被 Google 送中
👇
-------------------------
⟦ `+policy+` ⟧
-------------------------`: `
` + "
❌ ⟦ "+policy+ " ⟧ ⚠️ 切换失败
该策略组内未找到未被 Google 送中 的节点" + "
-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`
⚠️ 该节点 Google 送中检测失败
👇
-------------------------
⟦ `+policy+` ⟧
-------------------------`: content
108 | $done({"title":"Google 送中检测&切换", "htmlMessage": content})
109 | } else if (OKList[0]){ //支持, 但为节点
110 | content = `
🎉 该节点未被 Google 送中
👇
-------------------------
⟦ `+policy+` ⟧
-------------------------`
111 | $done({"title":"Google 送中检测&切换", "htmlMessage": content})
112 | }
113 | }, relay)
114 |
115 | }
116 |
117 | //选择最优延迟节点
118 | function ReOrder(cnt) {
119 | const array = cnt;
120 | const messageURL = {
121 | action: "url_latency_benchmark",
122 | content: array
123 | };
124 | $configuration.sendMessage(messageURL).then(resolve => {
125 | if (resolve.error) {
126 | console.log(resolve.error);
127 | }
128 | if (resolve.ret) {
129 | let output=JSON.stringify(resolve.ret);
130 | console.log("节点延迟:"+output);
131 | //排序
132 | console.log("排序前: "+ array)
133 | if(array){
134 | try {
135 | array.sort(function (a,b) {
136 | //console.log(a+" VS "+b)
137 | return (resolve.ret[a][1]!=-1 && resolve.ret[b][1] !=-1)? resolve.ret[a][1]-resolve.ret[b][1] : resolve.ret[b][1]
138 | })
139 | } catch (err) {
140 | console.log(err)
141 | }
142 | }
143 | console.log("排序后: "+array)
144 | let Ping =resolve.ret[array[0]]
145 | const dict = { [policy] : array[0]};
146 | if(array[0]) {
147 | console.log("选定未被送中节点:"+array[0]+"延迟数据为 👉"+Ping)
148 | Ping = " ⚡️ 节点延迟 ➟ 「 "+Ping + " 」 "
149 | }
150 | const mes1 = {
151 | action: "set_policy_state",
152 | content: dict
153 | };
154 | $configuration.sendMessage(mes1).then(resolve => {
155 | if (resolve.error) {
156 | console.log(resolve.error);
157 | content =pflag==0 && array[0]? `
🎉 该节点未被 Google 送中
👇
-------------------------
⟦ `+policy+` ⟧
-------------------------` : `
😭 该节点已被 Google 送中
👇
-------------------------
⟦ `+policy+` ⟧
-------------------------`
158 | content = pflag!=0 && !array[0]? `
` + "
❌ ⟦ "+policy+ " ⟧ ⚠️ 切换失败
该策略组内未找到未被 Google 送中 的节点" + "
-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`
` + "
⟦ "+policy+ " ⟧ 已切换至未被Google 送中延迟最优路线
👇
⟦ "+array[0]+ " ⟧" + "
"+Ping+"
-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`
😭 无有效节点`});
70 | }
71 | }
72 | //$notify(typeof(output),output)
73 | Check()
74 | //$done({"title":"策略内容","message":output})
75 | }
76 | //$done();|
77 | }, reject => {
78 | // Normally will never happen.
79 | $done();
80 | });
81 |
82 | function Len(cnt) {
83 | return cnt.length-1
84 | }
85 |
86 | function Check() {
87 | var relay = 2000;
88 | for ( var i=0;i < output.length;i++) {
89 | testNF(output[i])
90 | }
91 | if (output.length<=3) {
92 | relay = 3500
93 | } else if (output.length<=5) {
94 | relay = 4000
95 | } else if (output.length<10) {
96 | relay =4500
97 | } else if (output.length<15) {
98 | relay =6500
99 | } else if (output.length<20) {
100 | relay =8500
101 | } else if (output.length<50){
102 | relay =11000
103 | } else {
104 | relay =13000
105 | }
106 | console.log(output.length+":"+relay)
107 | setTimeout(() => {
108 | console.log("⛳️ 共计 "+OKList.length+" 个:完整支持节点 ➟"+ OKList)
109 | console.log("🏠 共计 "+Len(NoList)+" 个:"+NoList)
110 | console.log("🕹 共计 "+Len(timeoutList)+" 个:"+timeoutList)
111 | sign=1
112 | if (OKList[0] && pflag==1) {
113 | console.log("开始排序")
114 | ReOrder(OKList)
115 | } else if (!OKList[0]){ //不支持
116 | content =pflag==0 ? `
😭 该节点未完整支持 Netflix
👇
-------------------------
⟦ `+policy+` ⟧
-------------------------`: `
` + "
❌ ⟦ "+policy+ " ⟧ ⚠️ 切换失败
该策略组内未找到完整支持 Netflix 的节点" + "
-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`
🎉 该节点完整支持 Netflix
👇
-------------------------
⟦ `+policy+` ⟧
-------------------------`
120 | //content = `
🎉 该节点支持 Disneyᐩ ➟` + OKList[0].split(": 支持 ")[1]+`
👇
-------------------------
⟦ `+policy+` ⟧
-------------------------`
121 | $done({"title":"Netflix 检测&切换", "htmlMessage": content})
122 | }
123 | }, relay)
124 |
125 | }
126 |
127 | //选择最优延迟节点
128 | function ReOrder(cnt) {
129 | const array = cnt;
130 | const messageURL = {
131 | action: "url_latency_benchmark",
132 | content: array
133 | };
134 | $configuration.sendMessage(messageURL).then(resolve => {
135 | if (resolve.error) {
136 | console.log(resolve.error);
137 | }
138 | if (resolve.ret) {
139 | let output=JSON.stringify(resolve.ret);
140 | console.log("节点延迟:"+output);
141 | //排序
142 | console.log("排序前: "+ array)
143 | if(array){
144 | try {
145 | array.sort(function (a,b) {
146 | //console.log(a+" VS "+b)
147 | return (resolve.ret[a][1]!=-1 && resolve.ret[b][1] !=-1)? resolve.ret[a][1]-resolve.ret[b][1] : resolve.ret[b][1]
148 | })
149 | } catch (err) {
150 | console.log(err)
151 | }
152 | }
153 | console.log("排序后: "+array)
154 | let Ping =resolve.ret[array[0]]
155 | const dict = { [policy] : array[0]};
156 | if(array[0]) {
157 | console.log("选定完整支持节点:"+array[0]+"延迟数据为 👉"+Ping)
158 | Ping = " ⚡️ 节点延迟 ➟ 「 "+Ping + " 」 "
159 | }
160 | const mes1 = {
161 | action: "set_policy_state",
162 | content: dict
163 | };
164 | $configuration.sendMessage(mes1).then(resolve => {
165 | if (resolve.error) {
166 | console.log(resolve.error);
167 | content =pflag==0 && array[0]? `
` + "
⟦ "+policy+ " ⟧
🎉 该节点完整支持 Netflix" + `
` + "
⟦ "+policy+ " ⟧
⚠️ 该节点不支持 Netflix" + `
` + "
⟦ "+policy+ " ⟧
🚦 该节点仅支持 Netflix 自制剧集" + `
` + "
❌ ⟦ "+policy+ " ⟧ ⚠️ 切换失败
该策略组内未找到完整支持 Netflix 的节点" + "
-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`
` + "
⟦ "+policy+ " ⟧ 已切换至完整支持的路线中延迟最优节点
👇
⟦ "+array[0]+ " ⟧" + "
"+Ping+"
-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`
😭 无有效节点`});
86 | }
87 | }
88 |
89 | //$notify(typeof(output),output)
90 | Check()
91 | //$done({"title":"策略内容","message":output})
92 | }
93 | //$done();|
94 | }, reject => {
95 | // Normally will never happen.
96 | $done();
97 | });
98 |
99 | function Len(cnt) {
100 | return cnt.length-1
101 | }
102 |
103 | function Check() {
104 | var relay = 2000;
105 | for ( var i=0;i < output.length;i++) {
106 | testDisneyPlus(output[i])
107 | }
108 | if (output.length<=3) {
109 | relay = 3500
110 | } else if (output.length<=5) {
111 | relay = 4000
112 | } else if (output.length<10) {
113 | relay =4500
114 | } else if (output.length<15) {
115 | relay =6500
116 | } else if (output.length<20) {
117 | relay =8500
118 | } else if (output.length<50){
119 | relay =11000
120 | } else {
121 | relay =13000
122 | }
123 | console.log(output.length+":"+relay)
124 | setTimeout(() => {
125 | console.log("⛳️ 共计 "+OKList.length+" 个:支持节点 ➟ "+ OKList)
126 | console.log("🏠 共计 "+Len(NoList)+" 个:"+NoList)
127 | console.log("🕹 共计 "+Len(timeoutList)+" 个:"+timeoutList)
128 | sign = 1
129 | if (OKList[0] && pflag==1) { //有支持节点、且为策略组才操作
130 | console.log("开始排序")
131 | ReOrder(OKList)
132 | } else if (!OKList[0]){ //不支持
133 | content = pflag==0 ? `
😭 该节点不支持Disneyᐩ
👇
-------------------------
⟦ `+policy+` ⟧
-------------------------`: `
` + "
❌ ⟦ "+policy+ " ⟧ ⚠️ 切换失败
该策略组内未找到支持 Disneyᐩ 的节点" + "
-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`
🎉 该节点支持 Disneyᐩ ➟` + OKList[0].split(": 支持 ")[1]+`
👇
-------------------------
⟦ `+policy+` ⟧
-------------------------`
137 | $done({"title":"Disneyᐩ 检测&切换", "htmlMessage": content})
138 | }
139 | }, relay)
140 |
141 | }
142 |
143 |
144 |
145 | //选择最优延迟节点
146 | function ReOrder(cnt) {
147 | const array = cnt//;
148 | const messageURL = {
149 | action: "url_latency_benchmark",
150 | content: array.map(item=>item.split(": 支持 ")[0])
151 | };
152 | $configuration.sendMessage(messageURL).then(resolve => {
153 | if (resolve.error) {
154 | console.log(resolve.error);
155 | }
156 | if (resolve.ret) {
157 | let output=JSON.stringify(resolve.ret);
158 | //console.log("节点延迟:"+output);
159 | //排序
160 | //console.log("排序前: "+ array)
161 | if(array){
162 | try {
163 | array.sort(function (a,b) {
164 | //console.log(a+" VS "+b)
165 | a=a.split(": 支持 ")[0]
166 | b=b.split(": 支持 ")[0]
167 | return (resolve.ret[a][1]!=-1 && resolve.ret[b][1] !=-1)? resolve.ret[a][1]-resolve.ret[b][1] : resolve.ret[b][1]
168 | })
169 | } catch (err) {
170 | console.log(err)
171 | }
172 | }
173 | console.log("排序后: "+array)
174 | let Ping =resolve.ret[array[0].split(": 支持 ")[0]]
175 | const dict = { [policy] : array[0].split(": 支持 ")[0]};
176 | if(array[0]) {
177 | console.log("选定支持 Disneyᐩ 节点:"+array[0].split(": 支持 ")[0]+"延迟数据为 👉"+Ping)
178 | Ping = " ⚡️ 节点延迟 ➟ 「 "+Ping + " 」 "
179 | }
180 | const mes1 = {
181 | action: "set_policy_state",
182 | content: dict
183 | };
184 | $configuration.sendMessage(mes1).then(resolve => {
185 | if (resolve.error) {
186 | console.log(resolve.error);
187 | content =pflag==0 && array[0]? `
` + "
⟦ "+policy+ " ⟧
🎉 该节点支持 Disneyᐩ ➟" + array[0].split(": 支持 ")[1]+ `
` + "
⟦ "+policy+ " ⟧
⚠️ 该节点不支持 Disneyᐩ " + `
` + "
⟦ "+policy+ " ⟧
🚦 即将登陆节点所在地区 ➟" + ResList[1].split("登陆 ")[1]+`
` + "
❌ ⟦ "+policy+ " ⟧ ⚠️ 切换失败
该策略组内未找到支持 Disneyᐩ 的节点" + "
-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`
` + "
⟦ "+policy+ " ⟧ 已切换至支持 Disneyᐩ "+array[0].split(": 支持 ")[1]+"中延迟最优的路线
👇
⟦ "+array[0].split(": 支持 ")[0]+ " ⟧" + "
"+Ping+"
-----------------------------
检测详情请查看JS脚本记录
-----------------------------"+`
` + content + `
` 105 | // cnt = `` +'----------------------'+result["Disney"]+'----------------------'+$environment.params + `
` 106 | $configuration.sendMessage(message).then(resolve => { 107 | if (resolve.error) { 108 | console.log(resolve.error); 109 | $done() 110 | } 111 | if (resolve.ret) { 112 | let output=JSON.stringify(resolve.ret[message.content])? JSON.stringify(resolve.ret[message.content]).replace(/\"|\[|\]/g,"").replace(/\,/g," ➟ ") : $environment.params 113 | let content = "--------------------------------------"+([result["Dazn"],result["Discovery"],result["Paramount"],result["Disney"],result["ChatGPT"],result["Netflix"],result["YouTube"]]).join("") 114 | content = content + "--------------------------------------"+""+"节点 ➟ " + output+ "" 115 | content =`` + content + `
` 116 | //$notify(typeof(output),output) 117 | console.log(output); 118 | $done({"title":result["title"],"htmlMessage":content}) 119 | 120 | } 121 | //$done();| 122 | }, reject => { 123 | // Normally will never happen. 124 | $done(); 125 | }); 126 | //$done({"title":result["title"],"htmlMessage":content}) 127 | })() 128 | .finally(() => { 129 | 130 | $configuration.sendMessage(message).then(resolve => { 131 | if (resolve.error) { 132 | console.log(resolve.error); 133 | $done() 134 | } 135 | if (resolve.ret) { 136 | let output=JSON.stringify(resolve.ret[message.content])? JSON.stringify(resolve.ret[message.content]).replace(/\"|\[|\]/g,"").replace(/\,/g," ➟ ") : $environment.params 137 | let content = "--------------------------------------"+([result["Dazn"],result["Discovery"],result["Paramount"],result["Disney"],result["ChatGPT"],result["Netflix"],result["YouTube"]]).join("") 138 | content = content + "--------------------------------------"+""+"节点 ➟ " + output+ "" 139 | content =`` + content + `
` 140 | //$notify(typeof(output),output) 141 | console.log(output); 142 | $done({"title":result["title"],"htmlMessage":content}) 143 | 144 | } 145 | //$done();| 146 | }, reject => { 147 | // Normally will never happen. 148 | $done(); 149 | }); 150 | 151 | $done({"title":result["title"],"htmlMessage":``+'----------------------'+"🚥 检测异常"+'----------------------'+ output + `
`}) 152 | } 153 | ); 154 | 155 | 156 | async function testDisneyPlus() { 157 | try { 158 | let { region, cnbl } = await Promise.race([testHomePage(), timeout(7000)]) 159 | console.log(`homepage: region=${region}, cnbl=${cnbl}`) 160 | // 即将登陆 161 | // if (cnbl == 2) { 162 | // return { region, status: STATUS_COMING } 163 | // } 164 | let { countryCode, inSupportedLocation, accessToken } = await Promise.race([getLocationInfo(), timeout(7000)]) 165 | console.log(`getLocationInfo: countryCode=${countryCode}, inSupportedLocation=${inSupportedLocation}`) 166 | 167 | region = countryCode ?? region 168 | console.log( "region:"+region) 169 | // 即将登陆 170 | if (inSupportedLocation === false || inSupportedLocation === 'false') { 171 | return { region, status: STATUS_COMING } 172 | } else { 173 | // 支持解锁 174 | return { region, status: STATUS_AVAILABLE } 175 | } 176 | 177 | let support = await Promise.race([testPublicGraphqlAPI(accessToken), timeout(7000)]) 178 | if (!support) { 179 | return { status: STATUS_NOT_AVAILABLE } 180 | } 181 | // 支持解锁 182 | return { region, status: STATUS_AVAILABLE } 183 | 184 | } catch (error) { 185 | console.log("error:"+error) 186 | 187 | // 不支持解锁 188 | if (error === 'Not Available') { 189 | console.log("不支持") 190 | return { status: STATUS_NOT_AVAILABLE } 191 | } 192 | 193 | // 检测超时 194 | if (error === 'Timeout') { 195 | return { status: STATUS_TIMEOUT } 196 | } 197 | 198 | return { status: STATUS_ERROR } 199 | } 200 | 201 | } 202 | 203 | function getLocationInfo() { 204 | return new Promise((resolve, reject) => { 205 | let opts0 = { 206 | url: 'https://disney.api.edge.bamgrid.com/graph/v1/device/graphql', 207 | method: "POST", 208 | opts: opts, 209 | headers: { 210 | 'Accept-Language': 'en', 211 | "Authorization": 'ZGlzbmV5JmJyb3dzZXImMS4wLjA.Cu56AgSfBTDag5NiRA81oLHkDZfu5L3CKadnefEAY84', 212 | 'Content-Type': 'application/json', 213 | 'User-Agent': UA, 214 | }, 215 | body: JSON.stringify({ 216 | query: 'mutation registerDevice($input: RegisterDeviceInput!) { registerDevice(registerDevice: $input) { grant { grantType assertion } } }', 217 | variables: { 218 | input: { 219 | applicationRuntime: 'chrome', 220 | attributes: { 221 | browserName: 'chrome', 222 | browserVersion: '94.0.4606', 223 | manufacturer: 'apple', 224 | model: null, 225 | operatingSystem: 'macintosh', 226 | operatingSystemVersion: '10.15.7', 227 | osDeviceIds: [], 228 | }, 229 | deviceFamily: 'browser', 230 | deviceLanguage: 'en', 231 | deviceProfile: 'macosx', 232 | }, 233 | }, 234 | }), 235 | } 236 | 237 | $task.fetch(opts0).then(response => { 238 | let data = response.body 239 | console.log("locationinfo:"+response.statusCode) 240 | if (response.statusCode !== 200) { 241 | console.log('getLocationInfo: ' + data) 242 | reject('Not Available') 243 | return 244 | } else { 245 | let { 246 | token: { accessToken }, 247 | session: { 248 | inSupportedLocation, 249 | location: { countryCode }, 250 | }, 251 | } = JSON.parse(data)?.extensions?.sdk 252 | resolve({ inSupportedLocation, countryCode, accessToken }) 253 | } 254 | }, reason => { 255 | reject('Error') 256 | return 257 | }) 258 | }) 259 | } 260 | 261 | function testHomePage() { 262 | return new Promise((resolve, reject) => { 263 | let opts0 = { 264 | url: 'https://www.disneyplus.com/', 265 | opts: opts, 266 | headers: { 267 | 'Accept-Language': 'en', 268 | 'User-Agent': UA, 269 | }, 270 | } 271 | $task.fetch(opts0).then(response => { 272 | let data = response.body 273 | console.log("DisneyPlus: homepage"+response.statusCode) 274 | if (response.statusCode !== 200 || data.indexOf('not available in your region') !== -1) { 275 | reject('Not Available') 276 | return 277 | } else { 278 | let match = data.match(/Region: ([A-Za-z]{2})[\s\S]*?CNBL: ([12])/) 279 | if (!match) { 280 | resolve({ region: '', cnbl: '' }) 281 | return 282 | } else { 283 | let region = match[1] 284 | let cnbl = match[2] 285 | //console.log("homepage"+region+cnbl) 286 | resolve({ region, cnbl }) 287 | } 288 | } 289 | }, reason => { 290 | reject('Error') 291 | return 292 | }) 293 | }) 294 | } 295 | 296 | function testPublicGraphqlAPI(accessToken) { 297 | return new Promise((resolve, reject) => { 298 | let opts = { 299 | url: 'https://disney.api.edge.bamgrid.com/v1/public/graphql', 300 | headers: { 301 | 'Accept-Language': 'en', 302 | Authorization: accessToken, 303 | 'Content-Type': 'application/json', 304 | 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36', 305 | }, 306 | body: JSON.stringify({ 307 | query: 308 | 'query($preferredLanguages: [String!]!, $version: String) {globalization(version: $version) { uiLanguage(preferredLanguages: $preferredLanguages) }}', 309 | variables: { version: '1.5.0', preferredLanguages: ['en'] }, 310 | }), 311 | } 312 | 313 | $task.fetch(opts).then( response => { 314 | 315 | resolve(response.status === 200) 316 | }, reason => { 317 | reject('Error') 318 | return 319 | }) 320 | }) 321 | } 322 | 323 | function timeout(delay = 5000) { 324 | return new Promise((resolve, reject) => { 325 | setTimeout(() => { 326 | reject('Timeout') 327 | }, delay) 328 | }) 329 | } 330 | 331 | 332 | function testNf(filmId) { 333 | return new Promise((resolve, reject) =>{ 334 | let option = { 335 | url: BASE_URL + filmId, 336 | opts: opts, 337 | timeout: 5200, 338 | headers: { 339 | 'User-Agent': 340 | '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', 341 | }, 342 | } 343 | $task.fetch(option).then(response => { 344 | //$notify("nf:"+response.statusCode) 345 | console.log("nf:"+response.statusCode) 346 | if (response.statusCode === 404) { 347 | 348 | result["Netflix"] = "Netflix: 支持自制剧集 ⚠️" 349 | console.log("nf:"+result["Netflix"]) 350 | resolve('Not Found') 351 | return 352 | } else if (response.statusCode === 403) { 353 | 354 | //console.log("nfnf") 355 | result["Netflix"] = "Netflix: 未支持 🚫" 356 | console.log("nf:"+result["Netflix"]) 357 | //$notify("nf:"+result["Netflix"]) 358 | resolve('Not Available') 359 | return 360 | } else if (response.statusCode === 200) { 361 | let url = response.headers['X-Originating-URL'] 362 | let region = url.split('/')[3] 363 | region = region.split('-')[0] 364 | if (region == 'title') { 365 | region = 'us' 366 | } 367 | console.log("nf:"+region) 368 | result["Netflix"] = "Netflix: 完整支持"+arrow+ "⟦"+flags.get(region.toUpperCase())+"⟧ 🎉" 369 | //$notify("nf:"+result["Netflix"]) 370 | resolve("nf:"+result["Netflix"]) 371 | return 372 | } 373 | }, reason => { 374 | result["Netflix"] = "Netflix: 检测超时 🚦" 375 | console.log(result["Netflix"]) 376 | resolve("timeout") 377 | } 378 | ) 379 | } 380 | ) 381 | } 382 | 383 | function testYTB() { 384 | let option = { 385 | url: BASE_URL_YTB, 386 | opts: opts, 387 | timeout: 2800, 388 | headers: { 389 | 'User-Agent': 390 | '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' 391 | }, 392 | } 393 | $task.fetch(option).then(response=> { 394 | let data = response.body 395 | console.log("ytb:"+response.statusCode) 396 | if (response.statusCode !== 200) { 397 | //reject('Error') 398 | result["YouTube"] = "YouTube Premium: 检测失败 ❗️" 399 | } else if (data.indexOf('Premium is not available in your country') !== -1) { 400 | //resolve('Not Available') 401 | result["YouTube"] = "YouTube Premium: 未支持 🚫" 402 | } else if (data.indexOf('Premium is not available in your country') == -1) {//console.log(data.split("countryCode")[1]) 403 | let region = '' 404 | let re = new RegExp('"GL":"(.*?)"', 'gm') 405 | let ret = re.exec(data) 406 | if (ret != null && ret.length === 2) { 407 | region = ret[1] 408 | } else if (data.indexOf('www.google.cn') !== -1) { 409 | region = 'CN' 410 | } else { 411 | region = 'US' 412 | } 413 | //resolve(region) 414 | result["YouTube"] = "YouTube Premium: 支持 "+arrow+ "⟦"+flags.get(region.toUpperCase())+"⟧ 🎉" 415 | console.log("ytb:"+region+ result["YouTube"]) 416 | } 417 | }, reason => { 418 | result["YouTube"] = "YouTube Premium: 检测超时 🚦" 419 | //resolve("timeout") 420 | }) 421 | } 422 | 423 | function testDazn() { 424 | 425 | const extra =`{ 426 | "LandingPageKey":"generic", 427 | "Platform":"web", 428 | "PlatformAttributes":{}, 429 | "Manufacturer":"", 430 | "PromoCode":"", 431 | "Version":"2" 432 | }` 433 | let option = { 434 | url: BASE_URL_Dazn, 435 | method: "POST", 436 | opts: opts, 437 | timeout: 2800, 438 | headers: { 439 | 'User-Agent': 440 | 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36', 441 | "Content-Type": "application/json" 442 | }, 443 | body: extra 444 | } 445 | 446 | $task.fetch(option).then(response=> { 447 | let data = response.body 448 | //data = extra 449 | let header = JSON.stringify(response.headers) 450 | console.log("Dazn:"+response.statusCode) 451 | //console.log("Dazn:"+data) 452 | //$done(data) 453 | if (response.statusCode !== 200) { 454 | //reject('Error') 455 | result["Dazn"] = "Dazn: 检测失败 ❗️" 456 | } else if (response.statusCode == 200) {//console.log(data.split("countryCode")[1]) 457 | //console.log(data) 458 | let region = '' 459 | let re = new RegExp('"GeolocatedCountry":"(.*?)"', 'gm') 460 | let ret = re.exec(data) 461 | if (ret != null && ret.length === 2) { 462 | region = ret[1] 463 | result["Dazn"] = "Dazn: 支持 "+arrow+ "⟦"+flags.get(region.toUpperCase())+"⟧ 🎉" 464 | } else { 465 | result["Dazn"] = "Dazn: 未支持 🚫" 466 | 467 | } 468 | //resolve(region) 469 | console.log("Dazn:"+region+ result["Dazn"]) 470 | } 471 | }, reason => { 472 | result["Dazn"] = "Dazn: 检测超时 🚦" 473 | //resolve("timeout") 474 | }) 475 | } 476 | 477 | function testParam() { 478 | let option = { 479 | url: BASE_URL_Param, 480 | opts: opts1, 481 | timeout: 2800, 482 | headers: { 483 | 'User-Agent': 484 | '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' 485 | }, 486 | } 487 | $task.fetch(option).then(response=> { 488 | //let data = response.body 489 | console.log("Paramountᐩ:"+response.statusCode) 490 | if (response.statusCode == 200) { 491 | //reject('Error') 492 | result["Paramount"] = "Paramountᐩ: 支持 🎉 " 493 | } else if (response.statusCode == 302) { 494 | //resolve('Not Available') 495 | result["Paramount"] = "Paramountᐩ: 未支持 🚫" 496 | } 497 | console.log("Paramountᐩ:"+ result["Paramount"]) 498 | }, reason => { 499 | result["Paramount"] = "Paramountᐩ: 检测超时 🚦" 500 | //resolve("timeout") 501 | }) 502 | } 503 | 504 | 505 | function testDiscovery() { 506 | return new Promise((resolve, reject) =>{ 507 | let option = { 508 | url: BASE_URL_Discovery_token, 509 | opts: opts1, 510 | timeout: 2800, 511 | headers: { 512 | 'User-Agent': 513 | 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36' 514 | }, 515 | verify: false 516 | } 517 | $task.fetch(option).then(response=> { 518 | console.log("GetToken:"+response.statusCode) 519 | if(response.statusCode == 200) { 520 | let data = JSON.parse(response.body) 521 | console.log(data) 522 | let token = data["data"]["attributes"]["token"] 523 | const cookievalid =`_gcl_au=1.1.858579665.1632206782; _rdt_uuid=1632206782474.6a9ad4f2-8ef7-4a49-9d60-e071bce45e88; _scid=d154b864-8b7e-4f46-90e0-8b56cff67d05; _pin_unauth=dWlkPU1qWTRNR1ZoTlRBdE1tSXdNaTAwTW1Nd0xUbGxORFV0WWpZMU0yVXdPV1l6WldFeQ; _sctr=1|1632153600000; aam_fw=aam%3D9354365%3Baam%3D9040990; aam_uuid=24382050115125439381416006538140778858; st=${token}; gi_ls=0; _uetvid=a25161a01aa711ec92d47775379d5e4d; AMCV_BC501253513148ED0A490D45%40AdobeOrg=-1124106680%7CMCIDTS%7C18894%7CMCMID%7C24223296309793747161435877577673078228%7CMCAAMLH-1633011393%7C9%7CMCAAMB-1633011393%7CRKhpRz8krg2tLO6pguXWp5olkAcUniQYPHaMWWgdJ3xzPWQmdj0y%7CMCOPTOUT-1632413793s%7CNONE%7CvVersion%7C5.2.0; ass=19ef15da-95d6-4b1d-8fa2-e9e099c9cc38.1632408400.1632406594` 524 | let option1 = { 525 | url: BASE_URL_Discovery, 526 | opts: opts1, 527 | timeout: 2800, 528 | headers: { 529 | 'User-Agent': 530 | 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36', 531 | "Cookie": cookievalid, 532 | }, 533 | ciphers: "DEFAULT@SECLEVEL=1", 534 | verify: false 535 | } 536 | $task.fetch(option1).then(response=> { 537 | console.log("Discovery+ Check:"+response.statusCode) 538 | let data = JSON.parse(response.body) 539 | let locationd = data["data"]["attributes"]["currentLocationTerritory"] 540 | if (locationd == "us") { 541 | result["Discovery"] = "Discoveryᐩ: 支持 🎉 " 542 | console.log("支持Discoveryᐩ") 543 | resolve("支持Discoveryᐩ") 544 | return 545 | } else { 546 | result["Discovery"] = "Discoveryᐩ: 未支持 🚫" 547 | console.log("不支持Discoveryᐩ") 548 | resolve("不支持Discoveryᐩ") 549 | return 550 | } 551 | }, reason => { 552 | console.log("Check-Error"+reason) 553 | resolve("discovery failed") 554 | }) 555 | } else { 556 | console.log("GetToken-Error"+reason) 557 | resolve("discovery failed") 558 | } 559 | }, reason => { 560 | console.log("GetToken-Error"+reason) 561 | resolve("discovery failed") 562 | })})} 563 | 564 | 565 | // openai test 566 | 567 | support_countryCodes=["T1","XX","AL","DZ","AD","AO","AG","AR","AM","AU","AT","AZ","BS","BD","BB","BE","BZ","BJ","BT","BA","BW","BR","BG","BF","CV","CA","CL","CO","KM","CR","HR","CY","DK","DJ","DM","DO","EC","SV","EE","FJ","FI","FR","GA","GM","GE","DE","GH","GR","GD","GT","GN","GW","GY","HT","HN","HU","IS","IN","ID","IQ","IE","IL","IT","JM","JP","JO","KZ","KE","KI","KW","KG","LV","LB","LS","LR","LI","LT","LU","MG","MW","MY","MV","ML","MT","MH","MR","MU","MX","MC","MN","ME","MA","MZ","MM","NA","NR","NP","NL","NZ","NI","NE","NG","MK","NO","OM","PK","PW","PA","PG","PE","PH","PL","PT","QA","RO","RW","KN","LC","VC","WS","SM","ST","SN","RS","SC","SL","SG","SK","SI","SB","ZA","ES","LK","SR","SE","CH","TH","TG","TO","TT","TN","TR","TV","UG","AE","US","UY","VU","ZM","BO","BN","CG","CZ","VA","FM","MD","PS","KR","TW","TZ","TL","GB"] 568 | 569 | function testChatGPT() { 570 | return new Promise((resolve, reject) =>{ 571 | let option = { 572 | url: BASE_URL_GPT, 573 | opts: opts1, 574 | timeout: 2800, 575 | } 576 | $task.fetch(option).then(response=> { 577 | let resp = JSON.stringify(response) 578 | console.log("ChatGPT Main Test") 579 | let jdg = resp.indexOf("text/plain") 580 | if(jdg == -1) { 581 | let option1 = { 582 | url: Region_URL_GPT, 583 | opts: opts1, 584 | timeout: 2800, 585 | } 586 | $task.fetch(option1).then(response=> { 587 | console.log("ChatGPT Region Test") 588 | let region = response.body.split("loc=")[1].split("\n")[0] 589 | console.log("ChatGPT Region: "+region) 590 | let res = support_countryCodes.indexOf(region) 591 | if (res != -1) { 592 | result["ChatGPT"] = "ChatGPT: 支持 "+arrow+ "⟦"+flags.get(region.toUpperCase())+"⟧ 🎉" 593 | console.log("支持 ChatGPT") 594 | resolve("支持 ChatGPT") 595 | return 596 | } else { 597 | result["ChatGPT"] = "ChatGPT: 未支持 🚫" 598 | console.log("不支持 ChatGPT") 599 | resolve("不支持 ChatGPT") 600 | return 601 | } 602 | }, reason => { 603 | console.log("Check-Error"+reason) 604 | resolve("ChatGPT failed") 605 | }) 606 | } else { 607 | result["ChatGPT"] = "ChatGPT: 未支持 🚫" 608 | console.log("不支持 ChatGPT") 609 | resolve("不支持 ChatGPT") 610 | } 611 | }, reason => { 612 | console.log("ChatGPT-Error"+reason) 613 | resolve("ChatGPT failed") 614 | })})} --------------------------------------------------------------------------------