├── scripts
├── javascript
│ ├── BiliBili
│ │ ├── reject-dict.json
│ │ └── BiliBiliAds.6.74.0.sgmodule
│ ├── Youtube
│ │ ├── 17.16.4
│ │ │ ├── blank.txt
│ │ │ └── YouTubeAds.17.16.4.sgmodule
│ │ ├── 18.49.3
│ │ │ ├── blank.txt
│ │ │ └── YouTubeAds.18.49.3.sgmodule
│ │ └── README.md
│ ├── unblock
│ │ ├── CamScanner_Pro.js
│ │ ├── SYJZ_SVIP.js
│ │ ├── WPS_SVIP.js
│ │ ├── BaiduCloud.js
│ │ └── Mubu_SVIP.js
│ ├── TestFlight.js
│ ├── alipay.js
│ ├── backup
│ │ ├── netease.docker.js
│ │ ├── mt.js
│ │ ├── ksjsb.js
│ │ ├── elm.js
│ │ ├── wskey.js
│ │ ├── Location.js
│ │ ├── leave_kmmu.js
│ │ ├── qndxx.js
│ │ ├── leave_kmu.js
│ │ ├── xmSport.js
│ │ ├── epidemic_kmust.js
│ │ └── zsfc.js
│ └── panel
│ │ ├── network_info.js
│ │ └── restriction_check.js
├── python
│ └── zsfc
│ │ └── zsfc_login.py
└── greasyfork
│ └── sppet.js
├── platforms
├── boxjs
│ ├── chiupam.jpg
│ ├── icon
│ │ ├── me.png
│ │ ├── jd.jpeg
│ │ ├── kmmu.png
│ │ ├── kmu.jpg
│ │ ├── GitHub.jpg
│ │ ├── Header.jpeg
│ │ ├── Notice.jpeg
│ │ ├── Notify.jpg
│ │ ├── QQspeed.jpg
│ │ ├── YiBan.jpeg
│ │ ├── gdufe.jpeg
│ │ ├── kmmu.jpeg
│ │ ├── kmust.jpeg
│ │ ├── kmust.png
│ │ ├── qndxx.jpg
│ │ ├── qndxx.png
│ │ ├── setting.jpg
│ │ ├── tieba.png
│ │ ├── zsfc.jpeg
│ │ ├── Exchange.jpg
│ │ ├── For_Test.jpg
│ │ ├── JingDong.png
│ │ ├── Location.jpeg
│ │ ├── Location.png
│ │ ├── NoNotify.jpeg
│ │ ├── xmSport.jpeg
│ │ ├── Scriptable.png
│ │ ├── ShareCode.jpeg
│ │ └── Procuratorate.png
│ └── chiupam.boxjs.json
├── Surge
│ ├── backup
│ │ ├── TunOnly.sgmodule
│ │ ├── Cookie.sgmodule
│ │ ├── Panel.sgmodule
│ │ ├── CamScanner.sgmodule
│ │ ├── Scriptable.sgmodule
│ │ ├── Leave.sgmodule
│ │ ├── JD_wskey.sgmodule
│ │ ├── RRTV_SVIP.sgmodule
│ │ ├── BiliRegions.sgmodule
│ │ ├── ChangeUA.sgmodule
│ │ ├── Unblock.bak.sgmodule
│ │ ├── Unblock.sgmodule
│ │ ├── YouTubeAds.17.16.4.sgmodule
│ │ ├── WeiboAds.sgmodule
│ │ ├── MGTV.sgmodule
│ │ └── ZhiHuAds.sgmodule
│ ├── Study.sgmodule
│ ├── BaiduCloud.sgmodule
│ ├── Task.sgmodule
│ ├── Unblock.caiyun.sgmodule
│ ├── Script.sgmodule
│ ├── YouTubeAds.18.49.3.sgmodule
│ ├── Procuratorate.sgmodule
│ ├── AdvertisingScript.sgmodule
│ └── BiliBiliAds.6.74.0.sgmodule
└── Loon
│ ├── BaiduCloud.plugin
│ ├── Scriptable.plugin
│ ├── JD_wskey.plugin
│ ├── Leave.plugin
│ ├── TF-Download.plugin
│ ├── leave_gdufe.plugin
│ ├── KMUST.plugin
│ ├── qndxx.plugin
│ ├── Script.plugin
│ ├── Tasks.plugin
│ ├── Location.plugin
│ ├── ChangeUA.plugin
│ ├── BiliRegions.plugin
│ ├── Cookie.plugin
│ ├── Price.plugin
│ ├── YoutubeAds.plugin
│ ├── Unblock.plugin
│ ├── TakeAway.plugin
│ ├── BiliBili.plugin
│ └── WeiBoAds.plugin
├── .gitmodules
├── .gitignore
├── LICENSE
├── README.md
└── modules
└── core
└── chavyleung.Env.min.js
/scripts/javascript/BiliBili/reject-dict.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/scripts/javascript/Youtube/17.16.4/blank.txt:
--------------------------------------------------------------------------------
1 | 0
--------------------------------------------------------------------------------
/scripts/javascript/Youtube/18.49.3/blank.txt:
--------------------------------------------------------------------------------
1 | 0
--------------------------------------------------------------------------------
/platforms/boxjs/chiupam.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/chiupam.jpg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/me.png
--------------------------------------------------------------------------------
/platforms/boxjs/icon/jd.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/jd.jpeg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/kmmu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/kmmu.png
--------------------------------------------------------------------------------
/platforms/boxjs/icon/kmu.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/kmu.jpg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/GitHub.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/GitHub.jpg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/Header.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/Header.jpeg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/Notice.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/Notice.jpeg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/Notify.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/Notify.jpg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/QQspeed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/QQspeed.jpg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/YiBan.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/YiBan.jpeg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/gdufe.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/gdufe.jpeg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/kmmu.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/kmmu.jpeg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/kmust.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/kmust.jpeg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/kmust.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/kmust.png
--------------------------------------------------------------------------------
/platforms/boxjs/icon/qndxx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/qndxx.jpg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/qndxx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/qndxx.png
--------------------------------------------------------------------------------
/platforms/boxjs/icon/setting.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/setting.jpg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/tieba.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/tieba.png
--------------------------------------------------------------------------------
/platforms/boxjs/icon/zsfc.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/zsfc.jpeg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/Exchange.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/Exchange.jpg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/For_Test.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/For_Test.jpg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/JingDong.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/JingDong.png
--------------------------------------------------------------------------------
/platforms/boxjs/icon/Location.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/Location.jpeg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/Location.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/Location.png
--------------------------------------------------------------------------------
/platforms/boxjs/icon/NoNotify.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/NoNotify.jpeg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/xmSport.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/xmSport.jpeg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/Scriptable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/Scriptable.png
--------------------------------------------------------------------------------
/platforms/boxjs/icon/ShareCode.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/ShareCode.jpeg
--------------------------------------------------------------------------------
/platforms/boxjs/icon/Procuratorate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/Procuratorate.png
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "scripts/javascript/src"]
2 | path = scripts/javascript/src
3 | url = https://github.com/chiupam/obfuscatedSrc.git
4 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/TunOnly.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Tun Only
2 | #!desc= Only enable the Surge module when you need to enable compatibility mode.
3 |
4 | [General]
5 | compatibility-mode = 3
6 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/Cookie.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Cookie
2 | #!desc=This is a Surge module used to collect JaveScripts on Get Cookie.
3 | #!system=ios
4 |
5 | [Script]
6 |
7 | [MITM]
8 | hostname = %APPEDN%
9 |
--------------------------------------------------------------------------------
/scripts/javascript/Youtube/README.md:
--------------------------------------------------------------------------------
1 | # YouTube去广告
2 |
3 | 历史说明
4 |
5 | ### Version 17.16.4
6 |
7 | - 于 2023年12月20日 强制更新,但是脚本是能用的,只是应用无法进入主页
8 |
9 | ### Version 18.49.3
10 |
11 | - 2023年12月21日 最新版本,脚本亦可用
12 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/Panel.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Surge Panel
2 | #!desc=This is a module that collects Surge panels.
3 | #!system=ios
4 |
5 | [Panel]
6 | Network-info = script-name=网络信息, title="", content="", style=info, update-interval=60
7 |
8 | [Script]
9 | 网络信息 = type=generic, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/panel/network_info.js, type=generic, timeout=30
10 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/CamScanner.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=CamScanner SVIP
2 | #!desc=This is a Surge module for hacking CamScanner affiliates. CamScanner Version: 5.30.1.xxxxxx
3 |
4 | [MITM]
5 | hostname = %APPEND% ap*.intsig.net
6 |
7 | [Script]
8 | 全能扫描王 SVIP = type=http-response, pattern=^https:\/\/(api|api-cs)\.intsig\.net\/purchase\/cs\/query_property\?, requires-body=1, max-size=-1, script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/CamScanner.js
9 |
--------------------------------------------------------------------------------
/platforms/Surge/Study.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Study Module
2 | #!desc=This is a Surge module that collects scripts to assist in completing learning tasks for some learning apps.
3 |
4 | [Script]
5 | # > 学习强国app
6 | 计时器(视频) = type=http-request, pattern=^https?://boot-video2\.xuexi\.cn/video/.*.ts, requires-body=true, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/xxqg.js, script-update-interval=0, timeout=300
7 |
8 | [MITM]
9 | hostname = %APPEND% boot-video2.xuexi.cn
10 |
--------------------------------------------------------------------------------
/platforms/Surge/BaiduCloud.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Unblock Baidu Netdisc Play Speed
2 | #!desc=This is a Surge module for unblock Baidu netdisc unlocks online video play speed.
3 |
4 | [Script]
5 | # > 百度网盘SVIP (pan.baidu.com)
6 | 百度网盘SVIP = type=http-response, pattern=^https?://pan\.baidu\.com/rest/\d\.\d/membership/user, requires-body=1, max-size=0, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/unblock/BaiduCloud.js, script-update-interval=0, timeout=10
7 |
8 | [MITM]
9 | hostname = %APPEND% pan.baidu.com
10 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/Scriptable.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Scriptable Software
2 | #!desc=This is a Surge module used to collect JaveScripts on Scriptable App.
3 |
4 | [Script]
5 | # > 中国联通 (Scriptable)
6 | # > act.10010.com
7 | 中国联通(Scriptable) = type=http-request, pattern=^https?://act\.10010\.com/SigninApp/signin/querySigninActivity\.htm, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/scriptable/rewrite/10010.cookie.js, script-update-interval=0, timeout=60
8 |
9 | [MITM]
10 | hostname = %APPEND% act.10010.com
11 |
--------------------------------------------------------------------------------
/scripts/javascript/unblock/CamScanner_Pro.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | [Script]
4 | # > 全能扫描王 SVIP (ap*.intsig.net)
5 | 全能扫描王 SVIP = type=http-response, pattern=^https:\/\/(api|api-cs)\.intsig\.net\/purchase\/cs\/query_property\?, requires-body=1, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/unblock/CamScanner_Pro.js
6 |
7 | [MITM]
8 | hostname = %APPEND% ap*.intsig.net
9 |
10 | */
11 |
12 | let obj = JSON.parse($response.body);
13 | obj = {"data":{"psnl_vip_property":{"expiry":"1643731200"}}};
14 | $done({body: JSON.stringify(obj)});
15 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/Leave.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Mysterious Hacker
2 | #!desc=When you need to modify the leave information, open this module, and go to the BoxJs to modify the leave date.
3 |
4 | [Script]
5 | 神秘骇客 = type=http-response, pattern=^https?://xg\.kmmu\.edu\.cn/KmmcXG/webapi/api/(Leave/AllLeaveManage(_Edit)?|Student/GetStuHomePage|Student/GetStuPersonInfo)\?LoginStatus=.*, requires-body=1, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/leave_kmmu.js, script-update-interval=0, timeout=60
6 |
7 | [MITM]
8 | hostname = %APPEND% xg.kmmu.edu.cn
9 |
--------------------------------------------------------------------------------
/platforms/Loon/BaiduCloud.plugin:
--------------------------------------------------------------------------------
1 | #!name= Unblock Baidu Netdisc Play Speed
2 | #!desc= This is a Loon plugin for unblock Baidu netdisc unlocks online video play speed.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Nfcloud.png
6 |
7 | [Script]
8 | http-response https:\/\/pan\.baidu\.com\/rest\/\d\.\d\/membership\/user script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/BaiduCloud.js, requires-body=true, timeout=60, tag=百度网盘解锁在线播放倍数, enable = true
9 |
10 | [Mitm]
11 | hostname = pan.baidu.com
12 |
13 |
--------------------------------------------------------------------------------
/platforms/Loon/Scriptable.plugin:
--------------------------------------------------------------------------------
1 | #!name= Scriptable Software
2 | #!desc= This is a Loon plugin used to collect JaveScripts on Scriptable App.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/Scriptable.png
6 |
7 | [Script]
8 | http-request ^https?://act\.10010\.com/SigninApp/signin/querySigninActivity\.htm script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/scriptable/rewrite/10010.cookie.js, timeout=60, tag=中国联通(Scriptable), enable = true
9 |
10 | [Mitm]
11 | hostname = act.10010.com
12 |
13 |
--------------------------------------------------------------------------------
/platforms/Loon/JD_wskey.plugin:
--------------------------------------------------------------------------------
1 | #!name= Intercept JD's wskey
2 | #!desc= This is a Loon plugin used to intercept JD's wskey.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/jd.jpeg
6 |
7 | [Script]
8 | http-request ^https?://api-dd\.jd\.com/client\.action\?functionId=getSessionLog script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/wskey.js, requires-body=true, timeout=10, tag=京东上传wskey, argument=api=1185488678&H4FLgB6NklKaJNEDZ5t_6Pp-iux4DJnEU, enable = true
9 |
10 | [Mitm]
11 | hostname = api-dd.jd.com
12 |
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # macOS系统文件
2 | .DS_Store
3 | .AppleDouble
4 | .LSOverride
5 | ._*
6 |
7 | # 缩略图
8 | .Trashes
9 | Thumbs.db
10 | ehthumbs.db
11 |
12 | # IDE文件
13 | .idea/
14 | .vscode/
15 | *.sublime-project
16 | *.sublime-workspace
17 |
18 | # 日志文件
19 | *.log
20 | npm-debug.log*
21 | yarn-debug.log*
22 | yarn-error.log*
23 |
24 | # 依赖目录
25 | node_modules/
26 |
27 | # 排除src目录下除了obfuscator.js外的所有JavaScript源文件
28 | scripts/javascripts/src/**/*.js
29 | !scripts/javascripts/src/obfuscator.js
30 |
31 | # 忽略临时的更新脚本
32 | update_*.sh
33 | fix_*.sh
34 |
35 | # 常见系统文件
36 | .DS_Store
37 | Thumbs.db
38 | desktop.ini
39 |
40 | # 编辑器临时文件
41 | .vscode/
42 | .idea/
43 | *.swp
44 | *.swo
45 | *~
--------------------------------------------------------------------------------
/platforms/Loon/Leave.plugin:
--------------------------------------------------------------------------------
1 | #!name= Ask For Leave
2 | #!desc= When you need to modify the leave information, open this plugin, and go to the BoxJs to modify the leave date.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/kmmu.png
6 |
7 | [Script]
8 | http-response ^https?://xg\.kmmu\.edu.cn/KmmcXG/webapi/api/Leave/AllLeaveManage(_Edit)?\?LoginStatus=.* script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/leave_kmmu.js, requires-body=true, timeout=60, tag=神秘骇客, enable = true
9 |
10 | [Mitm]
11 | hostname = xg.kmmu.edu.cn
12 |
13 |
--------------------------------------------------------------------------------
/scripts/javascript/TestFlight.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * 脚本说明:突破 TestFlight 下载限制,脚本搬运至 NobyDa 大佬。
4 | * 源地址:https://gist.githubusercontent.com/NobyDa/9be418b93afc5e9c8a8f4d28ae403cf2/raw/TF_Download.js
5 | *
6 | */
7 |
8 | const $ = new Env('')
9 |
10 | let Body = $.toObj($request.body)
11 | Body.storefrontId = '143380-1,29'
12 | $.done({body: $.toStr(Body)})
13 |
14 | function Env() {
15 | LN = typeof $loon != "undefined"
16 | SG = typeof $httpClient != "undefined" && !LN
17 | QX = typeof $task != "undefined"
18 | toObj = (str) => JSON.parse(str)
19 | toStr = (obj) => JSON.stringify(obj)
20 | done = (value = {}) => {$done(value)}
21 | return { toObj, toStr, done }
22 | }
23 |
--------------------------------------------------------------------------------
/scripts/javascript/unblock/SYJZ_SVIP.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | [Script]
4 | # > 鲨鱼记账 SVIP (api.shayujizhang.com)
5 | 鲨鱼记账 SVIP = type=http-response, pattern=https:\/\/api\.shayujizhang\.com\/account\/grant\/detail\/info, requires-body=1, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/unblock/SYJZ_SVIP.js
6 |
7 | [MITM]
8 | hostname = %APPEND% api.shayujizhang.com
9 |
10 | */
11 |
12 | var body = $response.body;
13 | var url = $request.url;
14 | const path1 = "/account/grant/detail/info/";
15 | if (url.indexOf(path1) != -1) {
16 | let obj = JSON.parse(body);
17 | obj.data.vip = {"isvip": 1,"days": 999};
18 | body = JSON.stringify(obj);
19 | }
20 | $done({body});
21 |
--------------------------------------------------------------------------------
/platforms/Loon/TF-Download.plugin:
--------------------------------------------------------------------------------
1 | #!name= TF Download
2 | #!desc= This is a Loon plugin used to collect JaveScripts for updating the testflight app.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/TestFlight_2.png
6 |
7 | [General]
8 | skip-proxy = iosapps.itunes.apple.com
9 |
10 | [Script]
11 | http-request ^https?:\/\/testflight\.apple\.com\/v2\/accounts\/.*\/apps\/\d*/builds/\d*/install, requires-body=true, timeout=10, tag=TF软件更新, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/TF_Download.js, enabled=true
12 |
13 | [Mitm]
14 | hostname = testflight.apple.com
15 |
--------------------------------------------------------------------------------
/platforms/Loon/leave_gdufe.plugin:
--------------------------------------------------------------------------------
1 | #!name= Ask For Leave(GDUFE)
2 | #!desc= When you need to modify the leave information, open this plugin, and go to the BoxJs to modify the leave date.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/gdufe.png
6 |
7 | [Script]
8 | http-response ^https?:\/\/student\.wozaixiaoyuan\.com\/(leave2\/getList\.json|leave2\/getLeave\.json|web\/leave2\/.*\?schoolId=89) script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/leave_gdufe.js, requires-body=true, timeout=60, tag=广东财经大学假条, enable = true
9 |
10 | [Mitm]
11 | hostname = student.wozaixiaoyuan.com
12 |
13 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/JD_wskey.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Intercept JD's wskey
2 | #!desc=This is a Surge module used to intercept JD's wskey. JD Version: 10.3.6, ID: 167963
3 |
4 | [Script]
5 | # > 使用方法:打开某东,然后点击右上角气泡(消息)按钮,等待数秒即可。
6 | # > 不推荐外人使用此模块,因为此模块如果没有配置正确,会直接发送 wskey 给我!
7 | # > 不希望懂技术的人员使用脚本攻击我的Telegram机器人,恳请各位技术人员手下留情!
8 | #
9 | # > 京东上传wskey
10 | # > api-dd.jd.com
11 | 京东上传wskey = type=http-request, argument=api=1185488678&H4FLgB6NklKaJNEDZ5t_6Pp-iux4DJnEU, pattern=^https?://api-dd\.jd\.com/client\.action\?functionId=getSessionLog, requires-body=1, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/wskey.js, script-update-interval=0, timeout=10
12 |
13 | [MITM]
14 | hostname = %APPEND% api-dd.jd.com
15 |
--------------------------------------------------------------------------------
/platforms/Loon/KMUST.plugin:
--------------------------------------------------------------------------------
1 | #!name= KMUST Epidemic
2 | #!desc= This is a Loon plugin for KMUST's daily epidemic check-in.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/kmust.png
6 |
7 | [Script]
8 | http-request ^https?://student\.wozaixiaoyuan\.com/heat/getTodayHeatList\.json script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/epidemic_kmust.js, requires-body=true, timeout=10, tag=昆工疫情SESSION, enable = true
9 | cron "1 0 7,12,22 * * *" script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/epidemic_kmust.js, tag=昆工疫情签到, enable=true
10 |
11 | [Mitm]
12 | hostname = student.wozaixiaoyuan.com
13 |
14 |
--------------------------------------------------------------------------------
/platforms/Loon/qndxx.plugin:
--------------------------------------------------------------------------------
1 | #!name= YunNan Young
2 | #!desc= This is a Loon plugin for YunNan Young.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/qndxx.png
6 |
7 | [Script]
8 | http-response ^http://home\.yngqt\.org\.cn/user/weixin_yngqt\.aspx\?getcode=.*|^https?://home\.yngqt\.org\.cn/qndxx/default\.aspx$ script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/qndxx.js, requires-body=true, timeout=5, tag=云南青年大学习Cookie, enable = true
9 | cron "13 13 13 * * *" script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/qndxx.js, tag=云南青年大学习, enable=true
10 |
11 | [Mitm]
12 | hostname = home.yngqt.org.cn
13 |
14 |
--------------------------------------------------------------------------------
/platforms/Surge/Task.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Tasks Module
2 | #!desc=This is a Surge module used to collect JaveScripts on daily task.
3 |
4 | [Script]
5 | # > 百度贴吧app
6 | 百度贴吧BDUSS = type=http-request, pattern=^https?://info\.tuisong\.baidu.com/v2/setter$, requires-body=0, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/tieba.js, script-update-interval=0
7 | 百度贴吧签到 = type=cron, cronexp="1 0 * * *", wake-system=1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/tieba.js, script-update-interval=0, timeout=60
8 |
9 | 水贝黄金价格 = type=cron, cronexp="1 17 * * *", wake-system=1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/kaka.js, script-update-interval=0, timeout=60
10 |
11 | [MITM]
12 | hostname = %APPEND% info.tuisong.baidu.com
13 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/RRTV_SVIP.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=RRTV Ads & SVIP
2 | #!desc=This is a Surge module used to collect JaveScripts on hacking RRTV and remove advertisings
3 | #!system=ios
4 |
5 | [Rule]
6 | AND, ((USER-AGENT, PUClient*), (NOT, ((DOMAIN-SUFFIX, rr.tv)))), REJECT
7 | URL-REGEX, ^https?:\/\/api\.rr\.tv\/(?:ad\/getAll$|storage/business/rootName/app/homePage), REJECT
8 |
9 | [Script]
10 | rrsp_video = type=http-response, requires-body=true, pattern=^https?:\/\/api\.rr\.tv\/watch\/v\d\/get_movie_info, script-path=https://Choler.github.io/Surge/Script/rrsp.js, script-update-interval=0, timeout=60
11 | rrsp_banner = type=http-response, requires-body=true, pattern=^https?:\/\/api\.rr\.tv\/v\dplus\/index\/channel, script-path=https://Choler.github.io/Surge/Script/rrsp.js, script-update-interval=0, timeout=60
12 |
13 | [MITM]
14 | hostname = %APPEND% api.rr.tv
15 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/BiliRegions.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Bilibili Region
2 | #!desc=This is a Surge module used to collect JaveScripts on Auto Change Bilibili Region.
3 | #!system=ios
4 |
5 | [Script]
6 | B站(换区) = type=http-response, pattern=^https:\/\/ap(p|i)\.bili(bili|api)\.(com|net)\/(pgc\/view\/v\d\/app\/season|x\/v\d\/search\/defaultwords)\?access_key, requires-body=1, max-size=0, script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Bili_Auto_Regions.js, script-update-interval=0, timeout=10
7 | B站(搜索) = type=http-request, pattern=^https:\/\/ap(p|i)\.bili(bili|api)\.(com|net)\/x\/v\d\/search(\/type)?\?.+?%20(%E6%B8%AF|%E5%8F%B0|%E4%B8%AD)&, script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Bili_Auto_Regions.js, script-update-interval=0, timeout=10
8 |
9 |
10 | [MITM]
11 | hostname = %APPEND% ap?.bili*i.com, ap?.bili*i.net
12 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/ChangeUA.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= Change User-Agent
2 | #!desc= This is a Surge module used to change user-agent on Safari.
3 |
4 | [URL Rewrite]
5 | # > 知乎(部分替换为手机百度 Quark 的 User-Agent)
6 | http-request ^https?:\/\/www\.zhihu\.com header-replace-regex User-Agent .+iPhone.+ "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/16C50 Quark/604.1 T7/10.3 SearchCraft/2.6.3 (Baidu; P1 8.0.0)"
7 | # > 百度(全站替换为手机百度 Quark 的 User-Agent)
8 | http-request ^https?:\/\/(?!d\.pcs).*(? 彩云天气 SVIP (biz.caiyunapp.com)
6 | 彩云天气 SVIP = type=http-response, pattern=https?:\/\/biz\.caiyunapp\.com\/(membership_rights|v2\/user), requires-body=1, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/unblock/ColorfulClouds_SVIP.js, script-update-interval=0, timeout=60
7 | # > 鲨鱼记账 SVIP (api.shayujizhang.com)
8 | 鲨鱼记账 SVIP = type=http-response, pattern=https:\/\/api\.shayujizhang\.com\/account\/grant\/detail\/info, requires-body=1, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/unblock/SYJZ_SVIP.js, script-update-interval=0, timeout=60
9 |
10 | [MITM]
11 | hostname = %APPEND% biz.caiyunapp.com, api.shayujizhang.com
12 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/Unblock.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Unblock Module
2 | #!desc=This is a Surge module used to collect JaveScripts on hacking, and it will use local resources.
3 |
4 | [Script]
5 | # > 百度网盘 SVIP (pan.baidu.com)
6 | # > Unblock Baidu netdisc unlocks online video play speed.
7 | 百度网盘 SVIP = type=http-response, pattern=^https?://pan\.baidu\.com/rest/\d\.\d/membership/user, requires-body=1, max-size=0, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/unblock/BaiduCloud.js, script-update-interval=0, timeout=10
8 |
9 | # > 全能扫描王
10 | # > Hacking CamScanner affiliates. CamScanner Version: 5.30.1.xxxxxx
11 | 全能扫描王 SVIP = type=http-response, pattern=^https:\/\/(api|api-cs)\.intsig\.net\/purchase\/cs\/query_property\?, requires-body=1, max-size=-1, script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/CamScanner.js
12 |
13 | [MITM]
14 | hostname = %APPEND% pan.baidu.com, ap*.intsig.net
15 |
--------------------------------------------------------------------------------
/platforms/Surge/Unblock.caiyun.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Caiyun App Module
2 | #!desc=This is a Surge module used to collect JaveScripts on hacking for Caiyuntianqi Applicaitons.
3 |
4 | [Script]
5 | 彩云天气 = type=http-request,pattern=^https?:\/\/(api|wrapper)\.(cyapi|caiyunapp)\.(cn|com)\/v\d\/(satellite|nafp\/origin_images),requires-body=1,max-size=0,binary-body-mode=0,script-path=https://raw.githubusercontent.com/chxm1023/Rewrite/main/caiyuntianqi.js ,script-update-interval=0
6 | 彩云天气 = type=http-response,pattern=^https?:\/\/(biz|wrapper|starplucker)\.(cyapi|caiyunapp)\.(cn|com)\/(.+\/(user\?app_name|activity\?app_name|visitors|operation\/banners|operation\/homefeatures|config)|p\/v\d\/(vip_info|user_info|entries|privileges|trial_card\/info)),requires-body=1,max-size=0,binary-body-mode=0,script-path=https://raw.githubusercontent.com/chxm1023/Rewrite/main/caiyuntianqi.js,script-update-interval=0
7 |
8 | [MITM]
9 | hostname = %APPEND% *.cyapi.cn, *.caiyunapp.com
10 |
--------------------------------------------------------------------------------
/platforms/Loon/BiliRegions.plugin:
--------------------------------------------------------------------------------
1 | #!name= Bilibili Region
2 | #!desc= This is a Loon plugin used to collect JaveScripts on Auto Change Bilibili Region.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/bilibili_3.png
6 |
7 | [Script]
8 | http-request ^https:\/\/ap(p|i)\.bili(bili|api)\.(com|net)\/x\/v\d\/search(\/type)?\?.+?%20(%E6%B8%AF|%E5%8F%B0|%E4%B8%AD)& script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Bili_Auto_Regions.js, timeout=10, tag=B站(搜索), enable = true
9 | http-response ^https:\/\/ap(p|i)\.bili(bili|api)\.(com|net)\/(pgc\/view\/v\d\/app\/season|x\/v\d\/search\/defaultwords)\?access_key script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Bili_Auto_Regions.js, requires-body=true, timeout=10, tag=B站(换区), enable = true
10 |
11 | [Mitm]
12 | hostname = ap?.bili*i.com,ap?.bili*i.net
13 |
14 |
--------------------------------------------------------------------------------
/platforms/Loon/Cookie.plugin:
--------------------------------------------------------------------------------
1 | #!name= Cookie
2 | #!desc= This is a Loon plugin used to collect JaveScripts on Get Cookie.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Lab.png
6 |
7 | [Script]
8 | http-request ^https?://music\.163\.com/weapi/user/level script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/neteasemusic/neteasemusic.cookie.js, timeout=15, tag=网易云音乐获取Cookie
9 | http-request ^https?://tieba\.baidu\.com/mo/q/getUpConfigData script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/tieba.js, requires-body=true, timeout=15, tag=百度贴吧Cookie
10 | http-request ^https?://mwegame\.qq\.com/ams/sign/doSign/month script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/zsfc.js, requires-body=true, timeout=15, tag=掌上飞车Cookie
11 |
12 | [Mitm]
13 | hostname = music.163.com,tieba.baidu.com,mwegame.qq.com
14 |
--------------------------------------------------------------------------------
/platforms/Surge/Script.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Scripts Module
2 | #!desc=This is a Surge module used to collect JaveScripts on daily use.
3 |
4 | [General]
5 | skip-proxy = %APPEND% iosapps.itunes.apple.com
6 |
7 | [Script]
8 | # > BoxJs TF
9 | BoxJs(TF) = type=http-request, pattern=^https?://boxjs.net, requires-body=1, timeout=120, script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/box/chavy.boxjs.js, script-update-interval=0, timeout=60
10 |
11 | # > TestFlight
12 | TestFlight = type=http-request, pattern=^https?:\/\/testflight\.apple\.com\/v\d\/accounts\/.+?\/install$, requires-body=1, script-update-interval=-1, max-size=0, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/TestFlight.js, script-update-interval=0, timeout=60
13 |
14 | [URL Rewrite]
15 | ^https://boxjs.net http://boxjs.net 302
16 | ^http://ww1.boxjs.net http://boxjs.net 302
17 | ^http://ww6.boxjs.net http://boxjs.net 302
18 |
19 | [MITM]
20 | hostname = %APPEND% boxjs.net, testflight.apple.com
21 |
--------------------------------------------------------------------------------
/platforms/Loon/Price.plugin:
--------------------------------------------------------------------------------
1 | #!name= Historical Price (Individual)
2 | #!desc= This is a Loon plugin used to collect the JaveScripts on historical price of Jingdong and Taobao.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/xxxxxx.jpeg
6 |
7 | [Script]
8 | http-request ^http://.+/amdc/mobileDispatch script-path=https://raw.githubusercontent.com/yichahucha/surge/master/tb_price.js, requires-body=true, timeout=60, tag=淘宝比价, enable = true
9 | http-response ^https?://trade-acs\.m\.taobao\.com/gw/mtop\.taobao\.detail\.getdetail script-path=https://raw.githubusercontent.com/yichahucha/surge/master/tb_price.js, requires-body=true, timeout=60, tag=淘宝比价, enable = true
10 | http-response ^https?://api\.m\.jd\.com/client\.action\?functionId=(wareBusiness|serverConfig|basicConfig) script-path=https://raw.githubusercontent.com/yichahucha/surge/master/jd_price.js, requires-body=true, timeout=60, tag=京东比价, enable = true
11 |
12 | [Mitm]
13 | hostname = api.m.jd.com
14 |
15 |
--------------------------------------------------------------------------------
/scripts/javascript/alipay.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 蚂蚁森林能量通知用户收取脚本
3 | */
4 |
5 | // 创建Env对象
6 | const $ = new Env(`🌲 蚂蚁森林收能量`);
7 |
8 | // 发送通知
9 | $.notice(
10 | $.name, // 标题
11 | "", // 副标题
12 | "点击立马收取296g能量!", // 消息内容
13 | "alipay://platformapi/startapp?appId=60000002" // 跳转链接
14 | );
15 |
16 | // 完成脚本
17 | $.done();
18 |
19 | /**
20 | * 创建Env对象
21 | * @returns {Object} 包含notice和done方法的对象
22 | */
23 | function Env(name) {
24 | // 判断运行环境
25 | LN = typeof $loon != "undefined"; // Loon
26 | SG = typeof $httpClient != "undefined" && !LN; // Surge
27 | QX = typeof $task != "undefined"; // Quantumult X
28 |
29 | // 发送通知
30 | notice = (title, subtitle, message, url) => {
31 | if (LN) $notification.post(title, subtitle, message, url); // Loon
32 | if (SG) $notification.post(title, subtitle, message, { url: url }); // Surge
33 | if (QX) $notify(title, subtitle, message, { "open-url": url }); // Quantumult X
34 | };
35 |
36 | // 完成脚本
37 | done = (value = {}) => {
38 | $done(value);
39 | };
40 |
41 | // 返回对象
42 | return { name, notice, done };
43 | }
44 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Chiupam
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/platforms/Loon/YoutubeAds.plugin:
--------------------------------------------------------------------------------
1 | #!name= YouTube Ads
2 | #!desc= This is a Loon plugin used to collect JaveScripts on Remove YouTube Ads. YouTube Version: 15.44.2
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/YouTube.png
6 |
7 | [Rule]
8 | URL-REGEX,^https?:\/\/s\.youtube\.com\/api\/stats\/qoe\?adcontext,REJECT-IMG
9 | URL-REGEX,^https?:\/\/(www|s)\.youtube\.com\/(pagead|ptracking),REJECT-IMG
10 | URL-REGEX,^https?:\/\/(www|s)\.youtube\.com\/api\/stats\/ads,REJECT-IMG
11 | URL-REGEX,^https?:\/\/youtubei\.googleapis\.com\/youtubei\/v\d\/player\/ad_break,REJECT-IMG
12 | URL-REGEX,^https?:\/\/[\w-]+\.googlevideo\.com\/(?!(dclk_video_ads|videoplayback\?)).+&oad,REJECT-IMG
13 | USER-AGENT,"(^https?:\/\/[\w-]+\.googlevideo\.com\/(?!dclk_video_ads).+?)&ctier=L(&.+?),ctier,(.+)",REJECT-IMG
14 |
15 | [Rewrite]
16 | (^https?:\/\/[\w-]+\.googlevideo\.com\/(?!dclk_video_ads).+?)&ctier=L(&.+?),ctier,(.+) $1$2$3 302
17 |
18 |
19 | [MITM]
20 | hostname = -redirector*.googlevideo.com,*.googlevideo.com,www.youtube.com,s.youtube.com,youtubei.googleapis.com
21 |
--------------------------------------------------------------------------------
/platforms/Loon/Unblock.plugin:
--------------------------------------------------------------------------------
1 | #!name= Unblock Module
2 | #!desc= This is a Loon plugin used to collect JaveScripts on hacking, and it will use local resources.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/icon/xxxxxx.jpeg
6 |
7 | [Script]
8 | http-response https?:\/\/biz\.caiyunapp\.com\/(membership_rights|v2\/user) script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/unblock/ColorfulClouds_SVIP.js, requires-body=true, timeout=60, tag=彩云天气SVIP, enable = true
9 | http-response https:\/\/pan\.baidu\.com\/rest\/2\.0\/membership\/user script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/unblock/BaiduCloud.js, requires-body=true, timeout=60, tag=百度网盘SVIP, enable = true
10 | http-response https:\/\/api\.shayujizhang\.com\/account\/grant\/detail\/info script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/unblock/SYJZ_SVIP.js, requires-body=true, timeout=60, tag=鲨鱼记账SVIP, enable = true
11 |
12 | [Mitm]
13 | hostname = biz.caiyunapp.com,pan.baidu.com,api.shayujizhang.com
14 |
15 |
--------------------------------------------------------------------------------
/scripts/javascript/Youtube/17.16.4/YouTubeAds.17.16.4.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=YouTube Ads
2 | #!desc=YouTube Version: 17.16.4; Date: 2023-06-16; Verification: Ture
3 |
4 | # > Credit
5 | # @Choler & @DivineEngine & @app2smile
6 | # > Github
7 | # https://github.com/Maasea/sgmodule/tree/master
8 | # > Raw Javascript
9 | # https://raw.githubusercontent.com/Maasea/sgmodule/544affd72b002db4bcc0640f2fd5b18751f3d7a3/Script/Youtube/youtube.js
10 | # https://raw.githubusercontent.com/Maasea/sgmodule/544affd72b002db4bcc0640f2fd5b18751f3d7a3/Script/Youtube/youtube.src.js
11 |
12 | [MITM]
13 | hostname = %APPEND% *.googlevideo.com, youtubei.googleapis.com
14 |
15 | [Script]
16 | YouTube去广告 = type=http-response, pattern=^https:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|search|reel\/reel_watch_sequence|guide|account\/get_setting)\?, requires-body=1, binary-body-mode=1, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/Youtube/youtube.js
17 |
18 | [Map Local]
19 | ^https?:\/\/[\w-]+\.googlevideo\.com\/initplayback.+&oad data="https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/Youtube/blank.txt" header="Content-Type: application/vnd.yt-ump"
20 |
--------------------------------------------------------------------------------
/platforms/Loon/TakeAway.plugin:
--------------------------------------------------------------------------------
1 | #!name= Take Away
2 | #!desc= This is a Loon plugin used to intercept take-away apps.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://github.com/Koolson/Qure/raw/master/IconSet/Color/Cat.png
6 |
7 | [Script]
8 | http-request ^https://h5\.ele\.me/restapi/biz.growth_finetune/v1/finetune/operate? script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/elm.js, requires-body=true, timeout=10, tag=饿了么Cookie, argument=api=1185488678&H4FLgB6NklKaJNEDZ5t_6Pp-iux4DJnEU, enable = true
9 | http-request ^https://web\.meituan\.com/wechat/index$ script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/mt.js, requires-body=true, timeout=10, tag=美团Token, argument=api=1185488678&H4FLgB6NklKaJNEDZ5t_6Pp-iux4DJnEU, enable = true
10 | http-request ^https?://api\.kuaishouzt\.com/rest/zt/appsupport/reco/content/settings$ script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/ksjsb.js, requires-body=true, timeout=10, tag=快手极速版Cookie, argument=api=1185488678&H4FLgB6NklKaJNEDZ5t_6Pp-iux4DJnEU, enable = true
11 |
12 | [Mitm]
13 | hostname = h5.ele.me,web.meituan.com,api.kuaishouzt.com
14 |
15 |
--------------------------------------------------------------------------------
/platforms/Surge/YouTubeAds.18.49.3.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=YouTube Ads
2 | #!desc=YouTube Version: 18.49.3; Date: 2023-12-21; Verification: Ture
3 |
4 | # > 源地址
5 | # https://raw.githubusercontent.com/Maasea/sgmodule/master/YoutubeAds.sgmodule
6 |
7 | [Rule]
8 | AND,((DOMAIN-SUFFIX,googlevideo.com), (PROTOCOL,UDP)),REJECT-NO-DROP
9 |
10 | [Script]
11 | YouTube(Request) = type=http-request,pattern=^https:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|reel\/reel_watch_sequence),requires-body=1,max-size=-1,binary-body-mode=1,script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/Youtube/18.49.3/youtube.request.js
12 | YouTube(Response) = type=http-response,pattern=^https:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|search|reel\/reel_watch_sequence|guide|account\/get_setting),requires-body=1,max-size=-1,binary-body-mode=1,script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/Youtube/18.49.3/youtube.response.js
13 |
14 | [Map Local]
15 | ^https?:\/\/[\w-]+\.googlevideo\.com\/initplayback.+&oad data="https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/Youtube/18.49.3/blank.txt"
16 |
17 | [MITM]
18 | hostname = %APPEND% *.googlevideo.com, youtubei.googleapis.com
19 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/YouTubeAds.17.16.4.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=YouTube Ads
2 | #!desc=YouTube Version: 17.16.4; Date: 2023-06-16; Verification: Ture; Date: 2023-12-20; Verification: False
3 |
4 | # > Credit
5 | # @Choler & @DivineEngine & @app2smile
6 | # > Github
7 | # https://github.com/Maasea/sgmodule/tree/master
8 | # > Raw Javascript
9 | # https://raw.githubusercontent.com/Maasea/sgmodule/544affd72b002db4bcc0640f2fd5b18751f3d7a3/Script/Youtube/17.16.4/youtube.js
10 | # https://raw.githubusercontent.com/Maasea/sgmodule/544affd72b002db4bcc0640f2fd5b18751f3d7a3/Script/Youtube/17.16.4/youtube.src.js
11 |
12 | [MITM]
13 | hostname = %APPEND% *.googlevideo.com, youtubei.googleapis.com
14 |
15 | [Script]
16 | YouTube去广告 = type=http-response, pattern=^https:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|search|reel\/reel_watch_sequence|guide|account\/get_setting)\?, requires-body=1, binary-body-mode=1, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/Youtube/17.16.4/youtube.js
17 |
18 | [Map Local]
19 | ^https?:\/\/[\w-]+\.googlevideo\.com\/initplayback.+&oad data="https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/Youtube/17.16.4/blank.txt" header="Content-Type: application/vnd.yt-ump"
20 |
--------------------------------------------------------------------------------
/scripts/javascript/Youtube/18.49.3/YouTubeAds.18.49.3.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=YouTube Ads
2 | #!desc=YouTube Version: 18.49.3; Date: 2023-12-21; Verification: Ture
3 |
4 | # > 源地址
5 | # https://raw.githubusercontent.com/Maasea/sgmodule/master/YoutubeAds.sgmodule
6 |
7 | [Rule]
8 | AND,((DOMAIN-SUFFIX,googlevideo.com), (PROTOCOL,UDP)),REJECT-NO-DROP
9 |
10 | [Script]
11 | YouTube(Request) = type=http-request,pattern=^https:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|reel\/reel_watch_sequence),requires-body=1,max-size=-1,binary-body-mode=1,script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/Youtube/18.49.3/youtube.request.js
12 | YouTube(Response) = type=http-response,pattern=^https:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|search|reel\/reel_watch_sequence|guide|account\/get_setting),requires-body=1,max-size=-1,binary-body-mode=1,script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/Youtube/18.49.3/youtube.response.js
13 |
14 | [Map Local]
15 | ^https?:\/\/[\w-]+\.googlevideo\.com\/initplayback.+&oad data="https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/Youtube/18.49.3/blank.txt"
16 |
17 | [MITM]
18 | hostname = %APPEND% *.googlevideo.com, youtubei.googleapis.com
19 |
--------------------------------------------------------------------------------
/platforms/Loon/BiliBili.plugin:
--------------------------------------------------------------------------------
1 | #!name= BiliBili Plugin
2 | #!desc= This is a Loon plugin for BiliBili.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/bilibili_3.png
6 |
7 | [Script]
8 | http-request ^https:\/\/app\.bilibili\.com\/x\/v\d\/search(\/type)?\?.+?%20(%E6%B8%AF|%E5%8F%B0|%E4%B8%AD)& script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Bili_Auto_Regions.js, requires-body=true, timeout=10, tag=bilibili自动地区(搜索)
9 | http-response ^https:\/\/ap(p|i)\.bilibili\.com\/(pgc\/view\/(v\d\/)?app|x(\/v\d)?\/view\/video)\/(season|online)\?access_key script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Bili_Auto_Regions.js, requires-body=true, timeout=10, tag=bilibili自动地区
10 | http-response ^https:\/\/app\.bilibili\.com\/x\/v2\/account\/myinfo script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Bilibili-DailyBonus/Manga.js, requires-body=true, timeout=10, tag=哔哩哔哩漫画cookie
11 | cron "0,05,10 0 12 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Bilibili-DailyBonus/ExchangePoints.js, tag=哔哩哔哩抢券
12 | cron "0 9,20 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Bilibili-DailyBonus/Manga.js, tag=哔哩哔哩漫画签到
13 |
14 | [MITM]
15 | hostname = app.bilibili.com,ap?.bili*i.com,ap?.bili*i.net
16 |
--------------------------------------------------------------------------------
/scripts/javascript/unblock/WPS_SVIP.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | [Script]
4 | # > WPS SVIP (account.wps.cn)
5 | WPS SVIP = type=http-response, pattern=^https?:\/\/account\.wps\.cn\/api\/users, requires-body=1, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/unblock/WPS_SVIP.js
6 |
7 | [MITM]
8 | hostname = %APPEND% account.wps.cn
9 |
10 | */
11 |
12 | var obj = JSON.parse($response.body);
13 |
14 | var id = obj.userid;
15 |
16 | obj = {
17 | exp: 0,
18 | level: 3,
19 | privilege: [
20 | { spid: "data_recover", times: 0, expire_time: 2524579199 },
21 | { spid: "ocr", times: 0, expire_time: 2524579199 },
22 | { spid: "pdf2doc", times: 0, expire_time: 2524579199 },
23 | { spid: "pdf_merge", times: 0, expire_time: 2524579199 },
24 | { spid: "pdf_sign", times: 0, expire_time: 2524579199 },
25 | { spid: "pdf_split", times: 0, expire_time: 2524579199 }
26 | ],
27 | result: "ok",
28 | total_buy: 0,
29 | total_cost: -30,
30 | userid: 0000,
31 | vip: {
32 | name: "超级会员",
33 | has_ad: 0,
34 | memberid: 40,
35 | expire_time: 2524579199,
36 | enabled: [
37 | { memberid: 40, name: "超级会员", expire_time: 2524579199 },
38 | { memberid: 20, name: "WPS会员", expire_time: 2524579199 },
39 | { memberid: 12, name: "稻壳会员", expire_time: 2524579199 }
40 | ]
41 | },
42 | wealth: 0,
43 | expire_time: 2524579199
44 | };
45 |
46 | obj.userid = id;
47 |
48 | $done({ body: JSON.stringify(obj) });
49 |
--------------------------------------------------------------------------------
/scripts/javascript/unblock/BaiduCloud.js:
--------------------------------------------------------------------------------
1 | // 获取环境变量
2 | const $ = Env()
3 |
4 | // 设置请求体
5 | var Body = {
6 | "product_infos": [
7 | {
8 | "product_id": "5210897752128663390",
9 | "start_time": 1405674945,
10 | "end_time": 2147483648,
11 | "buy_time": "1405674945",
12 | "cluster": "offlinedl",
13 | "detail_cluster": "offlinedl",
14 | "product_name": "offlinedl_permanent"
15 | },
16 | {
17 | "product_name": "contentvip_nd",
18 | "product_description": "超级会员",
19 | "function_num": 0,
20 | "start_time": 1655518919,
21 | "buy_description": "",
22 | "buy_time": 0,
23 | "product_id": "1",
24 | "auto_upgrade_to_svip": 0,
25 | "end_time": 1687103999,
26 | "cluster": "vip",
27 | "detail_cluster": "svip",
28 | "status": 0
29 | }
30 | ],
31 | "currenttime": 1655745382,
32 | "reminder": {
33 | "reminderWithContent": [],
34 | "advertiseContent": []
35 | },
36 | "request_id": 508438507580862691
37 | }
38 |
39 | // 返回请求结果
40 | $.done({ body: $.toStr(Body) })
41 |
42 | // 环境变量函数
43 | function Env() {
44 | // 判断运行环境
45 | LN = typeof $loon != "undefined"; // Loon
46 | SG = typeof $httpClient != "undefined" && !LN; // Surge
47 | QX = typeof $task != "undefined"; // Quantumult X
48 |
49 | // 定义toStr函数,将对象转换为字符串
50 | toStr = (obj) => JSON.stringify(obj)
51 |
52 | // 定义done函数,返回请求结果
53 | done = (value = {}) => { $done(value) }
54 |
55 | // 返回环境变量对象
56 | return { toStr, done }
57 | }
58 |
--------------------------------------------------------------------------------
/scripts/javascript/unblock/Mubu_SVIP.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | [Script]
4 | # > 幕布 SVIP (api2.mubu.com)
5 | 幕布 SVIP = type=http-response, pattern=https?:\/\/api2\.mubu\.com\/v3\/api\/user\/current_user, requires-body=1, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/unblock/Mubu_SVIP.js
6 |
7 | [MITM]
8 | hostname = %APPEND% api2.mubu.com
9 |
10 | */
11 |
12 | var url = $request.url;
13 | const path = "/v3/api/user/current_user";
14 | if (url.indexOf(path) != -1) {
15 | let obj = JSON.parse($response.body);
16 | obj.data.vipEndDate = "20330912";
17 | body = JSON.stringify(obj);
18 | }
19 | $done({body});
20 |
21 | /*
22 | var obj = JSON.parse($response.body);
23 | obj={
24 | "code": 0,
25 | "msg": null,
26 | "data": {
27 | "facebookId": "",
28 | "facebookName": "",
29 | "province": "",
30 | "encryptPassword": null,
31 | "passSecure": false,
32 | "qqId": "",
33 | "updateTime": 1602941084029,
34 | "sort": "time",
35 | "googleName": "",
36 | "vipEndDate": "20330912",
37 | "city": "",
38 | "year": "",
39 | "agreeTermService": false,
40 | "name": "嘤嘤嘤",
41 | "appleName": "",
42 | "id": 4960640,
43 | "gender": "",
44 | "level": 2,
45 | "email": "",
46 | "wxId": "",
47 | "wxName": "",
48 | "phone": null,
49 | "toutiaoId": "",
50 | "appleId": "",
51 | "qqName": "",
52 | "view": "grid",
53 | "larkId": "",
54 | "googleId": "",
55 | "photo": "",
56 | "remark": "",
57 | "createTime": 1592534977160,
58 | "anonymUserFlag": 0
59 | }
60 | };
61 | $done({body: JSON.stringify(obj)});
62 | */
63 |
--------------------------------------------------------------------------------
/platforms/Loon/WeiBoAds.plugin:
--------------------------------------------------------------------------------
1 | #!name= Weibo Ads
2 | #!desc= This is a Loon plugin used to collect JaveScripts on Remove Weibo Ads.
3 | #!author= chiupam
4 | #!homepage= https://github.com/chiupam/surge/tree/main/Loon
5 | #!icon= https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Weibo.png
6 |
7 | [Script]
8 | http-response ^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/comments/build_comments\? script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_comment.js, requires-body=true, timeout=60, tag=微博(下面的评论), enable = true
9 | http-response ^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/(statuses/unread_hot_timeline|statuses/friends/timeline|video/tiny_stream_video_list|statuses/unread_friends_timeline)\? script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_statuses.js, requires-body=true, timeout=60, tag=微博(推荐|最新微博|全部关注), enable = true
10 | http-response ^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/(statuses/unread_hot_timeline|statuses/friends/timeline|video/tiny_stream_video_list|statuses/unread_friends_timeline)\? script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_cardlist.js, requires-body=true, timeout=60, tag=微博(发现|超话), enable = true
11 | http-response ^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/cardlist\? script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_cardlist_discover.js, requires-body=true, timeout=60, tag=微博(发现|超话), enable = true
12 | http-response ^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/statuses/extend\? script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_statuses_extend.js, requires-body=true, timeout=60, tag=微博(创作者广告共享计划), enable = true
13 | http-response ^https://sdkapp\.uve\.weibo\.com/interface/sdk/sdkad\.php$ script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_sdkad.js, requires-body=true, timeout=60, tag=微博(开屏广告), enable = true
14 |
15 | [Mitm]
16 | hostname = api.weibo.cn,mapi.weibo.com,sdkapp.uve.weibo.com
17 |
18 |
--------------------------------------------------------------------------------
/platforms/Surge/Procuratorate.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Procuratorate Sign In
2 | #!desc=This is a Surge module used to work check in.
3 |
4 |
5 | [Script]
6 | # > 使用方法:打开工作打卡的小程序手动进行一次打卡即可。
7 | 工作打卡Cookie = type=http-request, pattern=^https?://zhcj\.kmcgjcy\.cn/AttendanceCard/SaveAttCheckinout$, requires-body=1, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/procuratorate.js, script-update-interval=0, timeout=10
8 | 工作打卡 = type=cron, cronexp="17 46,51,55 8 * * 0", wake-system=1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/procuratorate.js, script-update-interval=0, timeout=300
9 | 工作打卡 = type=cron, cronexp="38 43,51,56 8 * * 1", wake-system=1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/procuratorate.js, script-update-interval=0, timeout=300
10 | 工作打卡 = type=cron, cronexp="24 44,48,57 8 * * 2", wake-system=1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/procuratorate.js, script-update-interval=0, timeout=300
11 | 工作打卡 = type=cron, cronexp="45 47,53,55 8 * * 3", wake-system=1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/procuratorate.js, script-update-interval=0, timeout=300
12 | 工作打卡 = type=cron, cronexp="51 48,50,57 8 * * 4", wake-system=1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/procuratorate.js, script-update-interval=0, timeout=300
13 | 工作打卡 = type=cron, cronexp="19 43,49,56 8 * * 5", wake-system=1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/procuratorate.js, script-update-interval=0, timeout=300
14 | 工作打卡 = type=cron, cronexp="13 45,52,54 8 * * 6", wake-system=1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/procuratorate.js, script-update-interval=0, timeout=300
15 | 工作打卡 = type=cron, cronexp="33 3,21,41 17 * * *", wake-system=1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/procuratorate.js, script-update-interval=0, timeout=60
16 |
17 | [MITM]
18 | hostname = %APPEND% zhcj.kmcgjcy.cn
19 |
--------------------------------------------------------------------------------
/platforms/Surge/backup/WeiboAds.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Weibo Ads
2 | #!desc=This is a Surge module used to collect JaveScripts on Remove Weibo Ads.
3 |
4 | [Script]
5 | # > 微博下面的评论
6 | 微博(下面的评论) = type=http-response, requires-body=1, max-size=0, pattern=^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/comments/build_comments\?, script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_comment.js, script-update-interval=0, timeout=60
7 | # > 微博 推荐 热门/榜单/放映厅… https://api.weibo.cn/2/statuses/unread_hot_timeline?
8 | # > 微博 最新微博 https://api.weibo.cn/2/statuses/friends/timeline?
9 | # > 视频流(短视频上划,微博继续推荐新视频) https://api.weibo.cn/2/video/tiny_stream_video_list?
10 | # > 微博 全部关注 https://api.weibo.cn/2/statuses/unread_friends_timeline?
11 | 微博(推荐|最新微博|全部关注) = type=http-response, requires-body=1, max-size=0, pattern=^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/(statuses/unread_hot_timeline|statuses/friends/timeline|video/tiny_stream_video_list|statuses/unread_friends_timeline)\?, script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_statuses.js, script-update-interval=0, timeout=60
12 | # > 发现 搜索 https://api.weibo.cn/2/searchall?
13 | # > 超话 帖子/精华/官方 https://api.weibo.cn/2/page?
14 | 微博(发现|超话) = type=http-response, requires-body=1, max-size=0, pattern=^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/(statuses/unread_hot_timeline|statuses/friends/timeline|video/tiny_stream_video_list|statuses/unread_friends_timeline)\?, script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_cardlist.js, script-update-interval=0, timeout=60
15 | # > 发现 热点(这货特殊,有卡片广告) https://api.weibo.cn/2/cardlist?
16 | 微博(发现|超话) = type=http-response, requires-body=1, max-size=0, pattern=^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/cardlist\?, script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_cardlist_discover.js, script-update-interval=0, timeout=60
17 | # > 每条微博下面 创作者广告共享计划
18 | 微博(创作者广告共享计划) = type=http-response, requires-body=1, max-size=0, pattern=^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/statuses/extend\?, script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_statuses_extend.js, script-update-interval=0, timeout=60
19 | # > 开屏广告
20 | 微博(开屏广告) = type=http-response, requires-body=1, max-size=0, pattern=^https://sdkapp\.uve\.weibo\.com/interface/sdk/sdkad\.php$, script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_sdkad.js, script-update-interval=0, timeout=60
21 |
22 | [MITM]
23 | hostname = %APPEND% api.weibo.cn, mapi.weibo.com, sdkapp.uve.weibo.com
24 |
--------------------------------------------------------------------------------
/platforms/Surge/AdvertisingScript.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=Advertising by JacaScripts
2 | #!desc=Use JacaScripts to remove advertisements and solve all kinds of troubles with advertisements.
3 | #!system=ios
4 |
5 | [Script]
6 | # > 京东
7 | 京东(开屏去广告) = type=http-response, requires-body=1, script-path=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/startup/startup.js, pattern=^https?:\/\/api\.m\.jd\.com\/client\.action\?functionId=start
8 | # > 微博下面的评论
9 | 微博(下面的评论) = type=http-response, requires-body=1, max-size=0, pattern=^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/comments/build_comments\?, script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_comment.js, script-update-interval=0, timeout=60
10 | # > 微博 推荐 热门/榜单/放映厅… https://api.weibo.cn/2/statuses/unread_hot_timeline?
11 | # > 微博 最新微博 https://api.weibo.cn/2/statuses/friends/timeline?
12 | # > 视频流(短视频上划,微博继续推荐新视频) https://api.weibo.cn/2/video/tiny_stream_video_list?
13 | # > 微博 全部关注 https://api.weibo.cn/2/statuses/unread_friends_timeline?
14 | 微博(推荐|最新微博|全部关注) = type=http-response, requires-body=1, max-size=0, pattern=^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/(statuses/unread_hot_timeline|statuses/friends/timeline|video/tiny_stream_video_list|statuses/unread_friends_timeline)\?, script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_statuses.js, script-update-interval=0, timeout=60
15 | # > 发现 搜索 https://api.weibo.cn/2/searchall?
16 | # > 超话 帖子/精华/官方 https://api.weibo.cn/2/page?
17 | 微博(发现|超话) = type=http-response, requires-body=1, max-size=0, pattern=^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/(statuses/unread_hot_timeline|statuses/friends/timeline|video/tiny_stream_video_list|statuses/unread_friends_timeline)\?, script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_cardlist.js, script-update-interval=0, timeout=60
18 | # > 发现 热点(这货特殊,有卡片广告) https://api.weibo.cn/2/cardlist?
19 | 微博(发现|超话) = type=http-response, requires-body=1, max-size=0, pattern=^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/cardlist\?, script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_cardlist_discover.js, script-update-interval=0, timeout=60
20 | # > 每条微博下面 创作者广告共享计划
21 | 微博(创作者广告共享计划) = type=http-response, requires-body=1, max-size=0, pattern=^https://(api\.weibo\.cn|mapi\.weibo\.com)/2/statuses/extend\?, script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_statuses_extend.js, script-update-interval=0, timeout=60
22 | # > 开屏广告
23 | 微博(开屏广告) = type=http-response, requires-body=1, max-size=0, pattern=^https://sdkapp\.uve\.weibo\.com/interface/sdk/sdkad\.php$, script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/weibo/weibo_sdkad.js, script-update-interval=0, timeout=60
24 |
25 | [MITM]
26 | hostname = %APPEND% api.m.jd.com, 103.41.167.236, 103.41.167.234, 103.41.167.235, 103.41.167.226, api.weibo.cn, mapi.weibo.com, sdkapp.uve.weibo.com
--------------------------------------------------------------------------------
/scripts/javascript/backup/netease.docker.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * 使用说明:抓包获取docker部署命令
4 | * 使用方法:打开QQ音乐APP,点击社区
5 | *
6 | * type: http-request
7 | * regex: ^https?://y\.qq\.com/v3/static/msg\.json\.z
8 | * script-paht: https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/netease.docker.js
9 | *
10 | * =============== Surge ===============
11 | * 网易云节点部署命令 = type=http-request, pattern=^https?://y\.qq\.com/v3/static/msg\.json\.z, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/javascript/netease.docker.js, script-update-interval=0, timeout=10
12 | *
13 | */
14 |
15 | const $ = Env()
16 | const user_id = $.read("TG_USER_ID") || arg().split(`&`)[0]
17 | const bot_token = $.read("TG_BOT_TOKEN") || `5099904762:AA` + arg().split(`&`)[1]
18 | const vps_ip = $.read("vps_ip")
19 | const vps_password = $.read("vps_password")
20 | if (typeof $request !== 'undefined') start()
21 |
22 | function arg() {
23 | try {return $argument.match(/api=(.*)/)[1]}
24 | catch {return `none&none`}
25 | }
26 |
27 | async function start() {
28 | cookie = $request.headers.Cookie
29 | try {qm_keyst = cookie.match(/qm_keyst=([^;]*)/)[1]} catch {qm_keyst = undefined}
30 | try {uin = cookie.match(/uin=([^;]*)/)[1]} catch {uin = undefined}
31 | if (qm_keyst && uin) {
32 | container = `docker run -dit --name netease --restart unless-stopped `
33 | container_parameters = `-p 55555:8080 -e ENABLE_FLAC=true -e QQ_COOKIE="uin=${uin}; qm_keyst=${qm_keyst}" `
34 | usering_images = `pan93412/unblock-netease-music-enhanced:latest `
35 | incoming_parameters = `-o qq `
36 | ios_parameters = `-s -e https://music.163.com`
37 | pc_command = container + container_parameters + usering_images + incoming_parameters
38 | ios_command = pc_command + ios_parameters
39 | command = `docker rm -f music netease; ${pc_command.replace(`netease`, `music`)}; ${ios_command.replace(`55555`, `55556`)}`
40 | await vps(command)
41 | }
42 | $.done()
43 | }
44 |
45 | function vps(text) {
46 | return new Promise(resolve => {
47 | const options = {
48 | url: `http://${vps_ip}/music`,
49 | body: `password=${vps_password}&command=${encodeURI(text)}`
50 | }
51 | $.post(options, (error, response, data) => {
52 | $.log(data)
53 | resolve()
54 | })
55 | })
56 | }
57 |
58 | function Env() {
59 | LN = typeof $loon != "undefined"
60 | SG = typeof $httpClient != "undefined" && !LN
61 | QX = typeof $task != "undefined"
62 | read = (key) => {
63 | if (LN || SG) return $persistentStore.read(key)
64 | if (QX) return $prefs.valueForKey(key)
65 | }
66 | get = (url, cb) => {
67 | if (LN || SG) {$httpClient.get(url, cb)}
68 | if (QX) {url.method = 'GET'; $task.fetch(url).then((resp) => cb(null, {}, resp.body))}
69 | }
70 | post = (url, cb) => {
71 | if (LN || SG) {$httpClient.post(url, cb)}
72 | if (QX) {url.method = `POST`; $task.fetch(url).then((resp) => cb(null, {}, resp.body))}
73 | }
74 | toStr = (obj) => JSON.stringify(obj)
75 | log = (message) => console.log(message)
76 | done = (value = {}) => {$done(value)}
77 | return { read, get, post, toStr, log, done }
78 | }
79 |
80 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
(\S*)<\/p>/) 129 | $.log(`✅ 最新一期期数:${$.title[1]}(${$.txtid})`) 130 | $.log(`✅ 最新一期名称:${$.title[2]}`) 131 | } else { 132 | $.txtid = $.toObj(`false`) 133 | $.log(`❌ 获取青年大学习时发生错误`) 134 | $.log($.toStr(error)) 135 | } 136 | resolve() 137 | }) 138 | }) 139 | } 140 | 141 | function study(id) { 142 | return new Promise((resolve) => { 143 | const options = { 144 | url: `http://home.yngqt.org.cn/qndxx/xuexi.ashx`, 145 | headers: headers, 146 | body: `{"txtid": ${id * 1}}` 147 | } 148 | $.log(`🧑💻 开始学习第${id}期青年大学习`) 149 | $.post(options, (error, response, data) => { 150 | if (data) { 151 | result = $.toObj(data).message 152 | $.log(`✅ ${result}`) 153 | } else { 154 | $.log(`❌ 学习第${id}期青年大学习时发生错误`) 155 | $.log($.toStr(error)) 156 | } 157 | resolve() 158 | }) 159 | }) 160 | } 161 | 162 | function Env(name) { 163 | LN = typeof $loon != "undefined" 164 | SG = typeof $httpClient != "undefined" && !LN 165 | QX = typeof $task != "undefined" 166 | read = (key) => { 167 | if (LN || SG) return $persistentStore.read(key) 168 | if (QX) return $prefs.valueForKey(key) 169 | } 170 | write = (key, val) => { 171 | if (LN || SG) return $persistentStore.write(key, val); 172 | if (QX) return $prefs.setValueForKey(key, val) 173 | } 174 | notice = (title, subtitle, message, url) => { 175 | if (LN) $notification.post(title, subtitle, message, url) 176 | if (SG) $notification.post(title, subtitle, message, { url: url }) 177 | if (QX) $notify(title, subtitle, message, { "open-url": url }) 178 | } 179 | get = (url, cb) => { 180 | if (LN || SG) {$httpClient.get(url, cb)} 181 | if (QX) {url.method = 'GET'; $task.fetch(url).then((resp) => cb(null, {}, resp.body))} 182 | } 183 | post = (url, cb) => { 184 | if (LN || SG) {$httpClient.post(url, cb)} 185 | if (QX) {url.method = 'POST'; $task.fetch(url).then((resp) => cb(null, {}, resp.body))} 186 | } 187 | toObj = (str) => JSON.parse(str) 188 | toStr = (obj) => JSON.stringify(obj) 189 | log = (message) => console.log(message) 190 | done = (value = {}) => {$done(value)} 191 | return { name, read, write, notice, get, post, toObj, toStr, log, done } 192 | } 193 | -------------------------------------------------------------------------------- /modules/core/chavyleung.Env.min.js: -------------------------------------------------------------------------------- 1 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}isShadowrocket(){return"undefined"!=typeof $rocket}isStash(){return"undefined"!=typeof $environment&&$environment["stash-version"]}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,n]=i.split("@"),a={url:`http://${n}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),n=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(n);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){if(t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),e(t,s,i)});else if(this.isQuanX())this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t&&t.error||"UndefinedError"));else if(this.isNode()){let s=require("iconv-lite");this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:i,statusCode:r,headers:o,rawBody:n}=t,a=s.decode(n,this.encoding);e(null,{status:i,statusCode:r,headers:o,rawBody:n,body:a},a)},t=>{const{message:i,response:r}=t;e(i,r,r&&s.decode(r.rawBody,this.encoding))})}}post(t,e=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient[s](t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),e(t,s,i)});else if(this.isQuanX())t.method=s,this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t&&t.error||"UndefinedError"));else if(this.isNode()){let i=require("iconv-lite");this.initGotEnv(t);const{url:r,...o}=t;this.got[s](r,o).then(t=>{const{statusCode:s,statusCode:r,headers:o,rawBody:n}=t,a=i.decode(n,this.encoding);e(null,{status:s,statusCode:r,headers:o,rawBody:n,body:a},a)},t=>{const{message:s,response:r}=t;e(s,r,r&&i.decode(r.rawBody,this.encoding))})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}queryStr(t){let e="";for(const s in t){let i=t[s];null!=i&&""!==i&&("object"==typeof i&&(i=JSON.stringify(i)),e+=`${s}=${i}&`)}return e=e.substring(0,e.length-1),e}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl,i=t["update-pasteboard"]||t.updatePasteboard;return{"open-url":e,"media-url":s,"update-pasteboard":i}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),this.isSurge()||this.isQuanX()||this.isLoon()?$done(t):this.isNode()&&process.exit(1)}}(t,e)} -------------------------------------------------------------------------------- /scripts/greasyfork/sppet.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 中检网自动学习 3 | // @namespace https://github.com/chiupam 4 | // @version 1.7 5 | // @description 中国检察教育培训网络学院全自动学习课程,点击学习中心,然后进入班级,最后刷新页面即可。 6 | // @author chiupam 7 | // @match https://www.sppet.cn/portal/play.do* 8 | // @match https://www.sppet.cn/examine/index.html* 9 | // @icon https://www.sppet.cn/examine/data/imgs/favicon.ico 10 | // @grant none 11 | // @license GNU GPLv3 12 | // @downloadURL https://update.greasyfork.org/scripts/479955/%E4%B8%AD%E6%A3%80%E7%BD%91%E8%87%AA%E5%8A%A8%E5%AD%A6%E4%B9%A0.user.js 13 | // @updateURL https://update.greasyfork.org/scripts/479955/%E4%B8%AD%E6%A3%80%E7%BD%91%E8%87%AA%E5%8A%A8%E5%AD%A6%E4%B9%A0.meta.js 14 | // ==/UserScript== 15 | 16 | (async function () { 17 | 'use strict'; 18 | 19 | // 动态插入日志容器到页面 20 | function createLogContainer() { 21 | const logContainer = document.createElement('div'); 22 | logContainer.id = 'log-container'; 23 | logContainer.style.padding = '10px'; // 设置容器内部的边距为 10px 24 | logContainer.style.backgroundColor = '#333'; // 设置背景颜色为深灰色 25 | logContainer.style.color = '#fff'; // 设置文本颜色为白色 26 | logContainer.style.border = '1px solid #ddd'; // 设置边框为 1px 的浅灰色实线,以区分容器和背景 27 | logContainer.style.maxHeight = `${window.innerHeight / 3}px`; // 设置容器的最大高度为 200px 28 | logContainer.style.maxWidth = '400px'; // 设置容器的最大宽度为 400px 29 | logContainer.style.overflowY = 'auto'; // 当内容超过容器高度时,自动显示垂直滚动条 30 | logContainer.style.position = 'fixed'; // 固定位置,始终显示在页面上 31 | logContainer.style.top = `${window.innerHeight / 3}px`; // 设置容器顶部距离页面顶部三分之一窗口高度的位置 32 | logContainer.style.right = '10px'; // 距离页面右侧10px 33 | logContainer.style.zIndex = '1000'; // 确保在页面上层显示 34 | 35 | document.body.appendChild(logContainer); // 将日志容器添加到页面中 36 | 37 | return logContainer; 38 | } 39 | 40 | // 添加日志到日志容器 41 | function logPage(logContainer, message) { 42 | console.log(message); // 同时在控制台输出日志 43 | 44 | const logEntry = document.createElement('div'); 45 | logEntry.textContent = message; // 设置日志内容 46 | logEntry.style.whiteSpace = 'nowrap'; // 禁止换行 47 | logEntry.style.overflow = 'hidden'; // 超出部分隐藏 48 | logEntry.style.textOverflow = 'ellipsis'; // 超出部分显示省略号 49 | logContainer.appendChild(logEntry); // 将日志内容添加到日志容器中 50 | logContainer.scrollTop = logContainer.scrollHeight; // 自动滚动到容器底部 51 | } 52 | 53 | // 格式化日期 54 | function formatDate() { 55 | // 获取 UTC 时间的毫秒数,并加上 8 小时的毫秒数 (8 * 60 * 60 * 1000) 56 | const offsetMilliseconds = 8 * 60 * 60 * 1000; 57 | const beijingTime = new Date(new Date().getTime() + offsetMilliseconds); 58 | 59 | // 格式化为 YYYY-MM-DD HH:MM:SS 60 | return beijingTime.toISOString().replace('T', ' ').split('.')[0]; 61 | } 62 | 63 | // 格式化播放时长 64 | function formatTime(seconds) { 65 | const hours = Math.floor(seconds / 3600); // 1小时 = 3600秒 66 | const minutes = Math.floor((seconds % 3600) / 60); // 1分钟 = 60秒 67 | const secs = Math.floor(seconds % 60); // 余下的秒数 68 | 69 | // 使用padStart确保两位数格式,不足两位的补0 70 | const formattedHours = String(hours).padStart(2, '0'); 71 | const formattedMinutes = String(minutes).padStart(2, '0'); 72 | const formattedSeconds = String(secs).padStart(2, '0'); 73 | 74 | if (formattedHours === '00') { // 如果没有小时数,只显示分钟和秒数 75 | return `${formattedMinutes}:${formattedSeconds}`; 76 | } else { // 如果有小时数,显示小时、分钟和秒数 77 | return `${formattedHours}:${formattedMinutes}:${formattedSeconds}` 78 | } 79 | } 80 | 81 | const logContainer = createLogContainer(); // 创建日志容器 82 | logPage(logContainer, `程序执行时间: ${formatDate()}`); 83 | 84 | if (window.location.href.includes('stady_detail')) { // 在学习详情页面执行以下操作 85 | const intervalId = setInterval(function() { 86 | const study = document.querySelectorAll('.btn'); // 获取所有继续学习的按钮元素 87 | const timeElement = document.querySelectorAll('.text_iconTime span:first-child span'); // 获取所有课程时间的元素 88 | const progress = document.querySelectorAll('.el-progress__text'); // 获取所有进度条的元素 89 | const name = document.querySelectorAll('.text_title.oneEllipsis'); // 获取所有课程的名称 90 | 91 | if (progress.length === 0) location.reload(); // 如果 progress.length 等于0, 刷新页面 92 | 93 | let count = 0; // 用于计数已完成课程的数量 94 | progress.forEach(element => {if (parseFloat(element.textContent.trim()) === 100) count++}); // 如果课程进度为100,计数加1 95 | 96 | if (count < progress.length) { // 如果有未完成的课程 97 | const division = `${count}/${progress.length}` // 计算已完成课程的数量和总课程数量 98 | const percentage = `${(count / progress.length * 100).toFixed(2)}%`; // 计算已完成课程的百分比 99 | logPage(logContainer, `总课程完成进度: ${division} (${percentage})`); 100 | 101 | // 遍历所有课程,找到未完成的课程并点击继续学习按钮 102 | for (let i = 0; i < progress.length; i++) { 103 | let progressFloat = parseFloat(progress[i].textContent.trim()); // 课程进度,转换为浮点数 104 | logPage(logContainer, `${name[i].textContent.trim()}`); 105 | 106 | if (progressFloat < 100) { 107 | logPage(logContainer, `上述课程进度: ${progressFloat}%,${progressFloat === 0 ? '开始' : '继续'}学习`); 108 | logPage(logContainer, `若未弹出新窗口, 请检查是否被浏览器拦截`); // 新窗口有可能被拦截, 提示一下用户 109 | localStorage.setItem('progressFloat', progressFloat); // 将进度保存到 localStorage 110 | study[i].click(); // 点击继续学习按钮 111 | break; // 找到并点击按钮后,停止遍历 112 | } else { 113 | logPage(logContainer, `上述课程已学完, 跳过`); 114 | }; 115 | }; 116 | } else { 117 | logPage(logContainer, '所有课程已完成'); 118 | }; 119 | 120 | clearInterval(intervalId); // 停止轮询 121 | }, 3000); // 每隔3秒检查一次 122 | 123 | } else if (window.location.href.includes('play.do')) { // 在播放页面执行以下操作 124 | let percentage = parseFloat(localStorage.getItem('progressFloat')); // 获取进度百分比 125 | 126 | let video; // 声明视频变量 127 | const intervalVideo = setInterval(function() { 128 | // 延迟获取视频元素,确保页面加载完成 129 | if (!video) { 130 | video = document.querySelector('video'); // 获取第一个视频元素 131 | if (!video) { 132 | logPage(logContainer, '未找到视频, 等待加载...'); 133 | return; // 如果未找到视频元素,继续等待 134 | } else { 135 | clearInterval(intervalVideo); // 视频播放完毕, 停止循环 136 | logPage(logContainer, '找到视频, 开始监控学习进度'); 137 | video.muted = true; // 强制静音 138 | 139 | // 事件监听器:视频播放结束时自动刷新第一个页面并关闭当前窗口 140 | video.addEventListener('ended', () => {localStorage.setItem('refresh', 'true'); window.close();}); 141 | video.addEventListener('pause', () => {video.play()}); // 事件监听器:视频暂停时自动播放 142 | video.addEventListener('volumechange', () => {video.muted = true}); // 事件监听器:视频音量变化时强制静音 143 | } 144 | } 145 | 146 | // 轮询检查 "开始学习" 或 "继续学习" 按钮 147 | const intervalChoise = setInterval(function() { 148 | const choise = document.querySelector('.user_choise'); // 获取选项元素 149 | if (choise) { 150 | clearInterval(intervalChoise); // 停止轮询 151 | choise.click(); // 点击 "开始学习" 或 "继续学习" 按钮 152 | } 153 | }); 154 | 155 | // 轮询检查并设置视频播放进度 156 | const intervalProgress = setInterval(function() { 157 | if (video.play() && video.duration) { 158 | clearInterval(intervalProgress); // 停止轮询 159 | const percentageToFixed = percentage.toFixed(2); // 将进度百分比转换为字符串并保留两位小数 160 | percentage > 2 ? percentage -= 1.9 : percentage = 0; // 如果进度大于2,则减去2,否则设为0 161 | video.currentTime = video.duration * (percentage / 100); // 设置视频播放位置 162 | logPage(logContainer, `已学习: ${formatTime(video.currentTime)}(${percentageToFixed}%)`); // 输出当前播放时间 163 | } 164 | }) 165 | }, 1000); // 每1秒检查一次 166 | 167 | } else { // 在第一个页面执行以下操作 168 | logPage(logContainer, '首先请先登录'); 169 | logPage(logContainer, '接着点击学习中心'); 170 | logPage(logContainer, '然后点击进入班级'); 171 | logPage(logContainer, '最后刷新浏览器'); 172 | } 173 | })(); 174 | 175 | // 在第一个页面中,添加以下脚本用于检测 localStorage 变化并执行刷新 176 | if (window.location.href.includes('www.sppet.cn') && !window.location.href.includes('play.do')) { 177 | window.addEventListener('storage', function(event) { 178 | if (event.key === 'refresh' && event.newValue === 'true') { 179 | localStorage.removeItem('refresh'); 180 | location.reload(); 181 | } 182 | }); 183 | } 184 | -------------------------------------------------------------------------------- /scripts/javascript/backup/leave_kmu.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | [Script] 4 | # 今日校园假条(kmu.campusphere.net) 5 | 今日校园假条 = type=http-response, pattern=^https:\/\/kmu\.campusphere\.net\/wec-counselor-leave-apps\/leave\/stu\/.*, requires-body=1, max-size=-1, script-path=https://raw.githubusercontent.com/chiupam/surge/main/scripts/leave_kmu.js 6 | 7 | [Mitm] 8 | hostname = %APPEND% kmu.campusphere.net 9 | 10 | git: https://github.com/chiupam/surge/blob/main/scripts/leave_kmm.js 11 | raw: https://raw.githubusercontent.com/chiupam/surge/main/scripts/leave_kmm.js 12 | 13 | */ 14 | 15 | const $ = new Env() 16 | var Url = $request.url 17 | var Body = JSON.parse($response.body) 18 | const isLeave = $.read('isLeave') || 'true' 19 | if (isLeave == 'false') { 20 | Body = JSON.parse($response.body) 21 | } else { 22 | var newDate = new Date() 23 | var Month = newDate.getMonth() + 1 24 | var Day = newDate.getDate() 25 | var Hour = newDate.getHours() 26 | var hours = Hour + 1 27 | if (hours < 10) { 28 | hours = 8 29 | auto_end_date = Day + 1 30 | } else { 31 | if (hours >= 11) { 32 | auto_begin_hours = Hour - 3 33 | var auto_begin_hours = ('0' + auto_begin_hours).slice(-2) 34 | } 35 | auto_end_date = Day 36 | } 37 | var preset_begin_date = ('0' + Day).slice(-2) 38 | var preset_end_date = ('0' + auto_end_date).slice(-2) 39 | var current_hours = ('0' + hours).slice(-2) 40 | const leaveType = $.read('leaveType') || '其他' 41 | const leaveReason = $.read('leaveReason') || '外出购买生活用品' 42 | const destination = $.read('destination') || '' 43 | const studentInfo = $.read('studentInfo') || '' 44 | const urgencyMobile = $.read('urgencyMobile') || '' 45 | const approverName = $.read('approverName') || '' 46 | const begin_date = $.read('begin_date') || preset_begin_date 47 | const end_date = $.read('end_date') || preset_end_date 48 | const begin_hours = $.read('begin_hours') || auto_begin_hours || '08' 49 | const end_hours = $.read('end_hours') || current_hours 50 | if (parseInt(end_date) >= parseInt(begin_date)) { 51 | begin_month = Month 52 | end_month = Month 53 | if (parseInt(end_date) == parseInt(begin_date)) { 54 | between_day = parseInt(end_date) - parseInt(begin_date) 55 | between_hour = parseInt(end_hours) - parseInt(begin_hours) 56 | } else { 57 | if ( parseInt(end_hours) >= parseInt(begin_hours)) { 58 | between_day = parseInt(end_date) - parseInt(begin_date) 59 | between_hour = parseInt(end_hours) - parseInt(begin_hours) 60 | } else { 61 | between_day = parseInt(end_date) - parseInt(begin_date) - 1 62 | between_hour = parseInt(end_hours) - parseInt(begin_hours) + 24 63 | } 64 | } 65 | } else { 66 | begin_month = Month 67 | end_month = Month + 1 68 | var Year = newDate.getFullYear() 69 | between_day = parseInt(end_date) - parseInt(begin_date) + new Date(Year, Month, 0).getDate() 70 | if (parseInt(end_hours) >= parseInt(begin_hours)) { 71 | between_hour = parseInt(end_hours) - parseInt(begin_hours) 72 | } else { 73 | between_hour = parseInt(end_hours) - parseInt(begin_hours) + 24 74 | } 75 | } 76 | const BeginMonth = ('0' + begin_month).slice(-2) 77 | const EndMonth = ('0' + end_month).slice(-2) 78 | const createDate = ('0' + (parseInt(begin_date) - 1)).slice(-2) 79 | const approverDate = ('0' + (parseInt(begin_date) - 1)).slice(-2) 80 | const BeginDate = ('0' + begin_date).slice(-2) 81 | const EndDate = ('0' + end_date).slice(-2) 82 | const LeaveBeginTime = ('0' + begin_hours).slice(-2) 83 | const LeaveEndTime = ('0' + end_hours).slice(-2) 84 | const leaveTime = between_day + "天" + between_hour + "小时0分钟" 85 | const createTime = BeginMonth + "-" + createDate + " " + (begin_hours - 2).toString() + ":11" 86 | const approverTime = BeginMonth + "-" + approverDate + " " + (begin_hours - 2).toString() + ":28" 87 | const startTime = BeginMonth + "-" + BeginDate + " " + LeaveBeginTime + ":00" 88 | const endTime = EndMonth + "-" + EndDate + " " + LeaveEndTime + ":00" 89 | if (Url.indexOf('list') != -1) { 90 | Body= { 91 | "message": "success", 92 | "datas": { 93 | "rows": [{ 94 | "leaveType": leaveType, 95 | "status": "2", 96 | "createTime":createTime, 97 | "startTime": startTime, 98 | "endTime": endTime, 99 | "leaveTime": leaveTime 100 | }] 101 | }, 102 | "code": "0" 103 | } 104 | } else if (Url.indexOf('detail') != -1) { 105 | Body= { 106 | "message": "SUCCESS", 107 | "datas": { 108 | "detail": { 109 | "startTime": startTime, 110 | "approvers": [{ 111 | "status": "1", 112 | "handled": true, 113 | "approveNode": [{ 114 | "createTime": createTime, 115 | "approvers": [], 116 | "status": "1" 117 | }], 118 | "approver": {"userName": studentInfo.split(",")[0]}, 119 | "createTime": createTime 120 | },{ 121 | "status": "3", 122 | "handled": true, 123 | "approveNode": [{ 124 | "nodeType": "1", 125 | "nodeWid": "1003", 126 | "nodeName": "辅导员", 127 | "approvers": [] 128 | }], 129 | "approver": {"userName": approverName}, 130 | "level": "1", 131 | "approveOption": "同意批假,路上注意个人防护!", 132 | "createTime": approverTime 133 | }], 134 | "leaveReason": leaveReason, 135 | "urgencyMobile": urgencyMobile, 136 | "totalDays": leaveTime, 137 | "destination": destination.toString().replace(/,/g, "/"), 138 | "leaveType": leaveType, 139 | "endTime": endTime, 140 | "outStatus": true, 141 | "status": "2", 142 | "applyLocation": { 143 | "locationType": 0, 144 | "latitude": "24.982288", 145 | "longitude": "102.805404", 146 | "address": "中国云南省昆明市官渡区阿拉街道云大北路1号" 147 | }, 148 | "actStatus": "7", 149 | "disclaimers": "本人承诺填写的信息真实有效,并对本次提交请假申请的信息真实性负责。", 150 | }, 151 | "studentInfo": { 152 | "userName": studentInfo.split(",")[0], 153 | "userId": studentInfo.split(",")[1], 154 | "dept": studentInfo.split(",")[2], 155 | "grade": studentInfo.split(",")[3], 156 | "major": studentInfo.split(",")[4], 157 | "cls": studentInfo.split(",")[5] 158 | }, 159 | "recordStatus": "6", 160 | "notOutReport": { 161 | "setedNotOutReport": 1, 162 | "rule": 0, 163 | "operatorName": "李雄", 164 | "operatorDate": "2021-06-07 10:06:36" 165 | } 166 | }, 167 | "code": "0" 168 | } 169 | } else { 170 | var s = "" 171 | var qr = "" 172 | for (let i = 0; i < 9; i ++) { 173 | qr += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1) 174 | } 175 | Body = { 176 | "message": "SUCCESS", 177 | "datas": { 178 | "qr": qr, 179 | "currentTime": new Date().Format("yyyy-MM-dd hh:mm:ss") 180 | }, 181 | "code": "0" 182 | } 183 | } 184 | } 185 | $.done({body: JSON.stringify(Body)}) 186 | 187 | function Env() { 188 | // NE = typeof module && !!module.exports != "undefined" 189 | LN = typeof $loon != "undefined" 190 | SG = typeof $httpClient != "undefined" && !LN 191 | QX = typeof $task != "undefined" 192 | read = (key) => { 193 | if (LN || SG) return $persistentStore.read(key) 194 | if (QX) return $prefs.valueForKey(key) 195 | } 196 | write = (key, val) => { 197 | if (LN || SG) return $persistentStore.write(key, val); 198 | if (QX) return $prefs.setValueForKey(key, val) 199 | } 200 | notice = (title, subtitle, message, url) => { 201 | if (LN) $notification.post(title, subtitle, message, url) 202 | if (SG) $notification.post(title, subtitle, message, { url: url }) 203 | if (QX) $notify(title, subtitle, message, { "open-url": url }) 204 | } 205 | get = (url, cb) => { 206 | if (LN || SG) {$httpClient.get(url, cb)} 207 | if (QX) {url.method = 'GET'; $task.fetch(url).then((resp) => cb(null, {}, resp.body))} 208 | } 209 | post = (url, cb) => { 210 | if (LN || SG) {$httpClient.post(url, cb)} 211 | if (QX) {url.method = 'POST'; $task.fetch(url).then((resp) => cb(null, {}, resp.body))} 212 | } 213 | put = (url, cb) => { 214 | if (LN || SG) {$httpClient.put(url, cb)} 215 | if (QX) {url.method = 'PUT'; $task.fetch(url).then((resp) => cb(null, {}, resp.body))} 216 | } 217 | log = (message) => console.log(message) 218 | done = (value = {}) => {$done(value)} 219 | return { LN, SG, QX, read, write, notice, get, post, put, log, done } 220 | } 221 | -------------------------------------------------------------------------------- /scripts/javascript/panel/restriction_check.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Form: https://raw.githubusercontent.com/LucaLin233/Luca_Conf/main/Surge/JS/stream-all.js 3 | */ 4 | 5 | // 即将登陆 6 | const STATUS_COMING = 2 7 | // 支持解锁 8 | const STATUS_AVAILABLE = 1 9 | // 不支持解锁 10 | const STATUS_NOT_AVAILABLE = 0 11 | // 检测超时 12 | const STATUS_TIMEOUT = -1 13 | // 检测异常 14 | const STATUS_ERROR = -2 15 | 16 | const UA = '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' 17 | 18 | ;(async () => { 19 | let panel_result = { 20 | title: '流媒体解锁检测', 21 | content: '请刷新面板', 22 | icon: 'play.tv.fill', 23 | 'icon-color': '#FF2D55', 24 | } 25 | let [{ region, status }] = await Promise.all([testDisneyPlus()]) 26 | await Promise.all([check_youtube_premium(),check_netflix()]) 27 | .then((result) => { 28 | console.log(result) 29 | let disney_result="" 30 | if (status==STATUS_COMING) { 31 | //console.log(1) 32 | disney_result="Disney+: 即将登陆~"+region.toUpperCase() 33 | } else if (status==STATUS_AVAILABLE){ 34 | //console.log(2) 35 | console.log(region) 36 | disney_result="Disney+: 已解锁 ➟ "+region.toUpperCase() 37 | // console.log(result["Disney"]) 38 | } else if (status==STATUS_NOT_AVAILABLE) { 39 | //console.log(3) 40 | disney_result="Disney+: 未支持 🚫 " 41 | } else if (status==STATUS_TIMEOUT) { 42 | disney_result="Disney+: 检测超时 🚦" 43 | } 44 | result.push(disney_result) 45 | console.log(result) 46 | let content = result.join('\n') 47 | console.log(content) 48 | 49 | panel_result['content'] = content 50 | }) 51 | .finally(() => { 52 | $done(panel_result) 53 | }) 54 | })() 55 | async function check_youtube_premium() { 56 | let inner_check = () => { 57 | return new Promise((resolve, reject) => { 58 | let option = { 59 | url: 'https://www.youtube.com/premium', 60 | headers: { 61 | 'User-Agent': UA, 62 | 'Accept-Language': 'en', 63 | }, 64 | } 65 | $httpClient.get(option, function (error, response, data) { 66 | if (error != null || response.status !== 200) { 67 | reject('Error') 68 | return 69 | } 70 | 71 | if (data.indexOf('Premium is not available in your country') !== -1) { 72 | resolve('Not Available') 73 | return 74 | } 75 | 76 | let region = '' 77 | let re = new RegExp('"countryCode":"(.*?)"', 'gm') 78 | let result = re.exec(data) 79 | if (result != null && result.length === 2) { 80 | region = result[1] 81 | } else if (data.indexOf('www.google.cn') !== -1) { 82 | region = 'CN' 83 | } else { 84 | region = 'US' 85 | } 86 | resolve(region) 87 | }) 88 | }) 89 | } 90 | 91 | let youtube_check_result = 'YouTube: ' 92 | 93 | await inner_check() 94 | .then((code) => { 95 | if (code === 'Not Available') { 96 | youtube_check_result += '不支持解锁' 97 | } else { 98 | youtube_check_result += '已解锁 ➟ ' + code.toUpperCase() 99 | } 100 | }) 101 | .catch((error) => { 102 | youtube_check_result += '检测失败,请刷新面板' 103 | }) 104 | 105 | return youtube_check_result 106 | } 107 | 108 | async function check_netflix() { 109 | let inner_check = (filmId) => { 110 | return new Promise((resolve, reject) => { 111 | let option = { 112 | url: 'https://www.netflix.com/title/' + filmId, 113 | headers: { 114 | 'User-Agent': UA, 115 | 'Accept-Language': 'en', 116 | }, 117 | } 118 | $httpClient.get(option, function (error, response, data) { 119 | if (error != null) { 120 | reject('Error') 121 | return 122 | } 123 | 124 | if (response.status === 403) { 125 | reject('Not Available') 126 | return 127 | } 128 | 129 | if (response.status === 404) { 130 | resolve('Not Found') 131 | return 132 | } 133 | 134 | if (response.status === 200) { 135 | let url = response.headers['x-originating-url'] 136 | let region = url.split('/')[3] 137 | region = region.split('-')[0] 138 | if (region == 'title') { 139 | region = 'us' 140 | } 141 | resolve(region) 142 | return 143 | } 144 | 145 | reject('Error') 146 | }) 147 | }) 148 | } 149 | 150 | let netflix_check_result = 'Netflix: ' 151 | 152 | await inner_check(81215567) 153 | .then((code) => { 154 | if (code === 'Not Found') { 155 | return inner_check(80018499) 156 | } 157 | netflix_check_result += '已完整解锁 ➟ ' + code.toUpperCase() 158 | return Promise.reject('BreakSignal') 159 | }) 160 | .then((code) => { 161 | if (code === 'Not Found') { 162 | return Promise.reject('Not Available') 163 | } 164 | 165 | netflix_check_result += '仅解锁自制剧 ➟ ' + code.toUpperCase() 166 | return Promise.reject('BreakSignal') 167 | }) 168 | .catch((error) => { 169 | if (error === 'BreakSignal') { 170 | return 171 | } 172 | if (error === 'Not Available') { 173 | netflix_check_result += '该节点不支持解锁' 174 | return 175 | } 176 | netflix_check_result += '检测失败,请刷新面板' 177 | }) 178 | 179 | return netflix_check_result 180 | } 181 | 182 | async function testDisneyPlus() { 183 | try { 184 | let { region, cnbl } = await Promise.race([testHomePage(), timeout(7000)]) 185 | console.log(`homepage: region=${region}, cnbl=${cnbl}`) 186 | let { countryCode, inSupportedLocation } = await Promise.race([getLocationInfo(), timeout(7000)]) 187 | console.log(`getLocationInfo: countryCode=${countryCode}, inSupportedLocation=${inSupportedLocation}`) 188 | region = countryCode ?? region 189 | console.log( "region:"+region) 190 | // 即将登陆 191 | if (inSupportedLocation === false || inSupportedLocation === 'false') { 192 | return { region, status: STATUS_COMING } 193 | } else { 194 | // 支持解锁 195 | return { region, status: STATUS_AVAILABLE } 196 | } 197 | } catch (error) { 198 | console.log("error:"+error) 199 | // 不支持解锁 200 | if (error === 'Not Available') { 201 | console.log("不支持") 202 | return { status: STATUS_NOT_AVAILABLE } 203 | } 204 | // 检测超时 205 | if (error === 'Timeout') { 206 | return { status: STATUS_TIMEOUT } 207 | } 208 | return { status: STATUS_ERROR } 209 | } 210 | } 211 | 212 | function getLocationInfo() { 213 | return new Promise((resolve, reject) => { 214 | let opts = { 215 | url: 'https://disney.api.edge.bamgrid.com/graph/v1/device/graphql', 216 | headers: { 217 | 'Accept-Language': 'en', 218 | Authorization: 'ZGlzbmV5JmJyb3dzZXImMS4wLjA.Cu56AgSfBTDag5NiRA81oLHkDZfu5L3CKadnefEAY84', 219 | 'Content-Type': 'application/json', 220 | 'User-Agent': UA, 221 | }, 222 | body: JSON.stringify({ 223 | query: 'mutation registerDevice($input: RegisterDeviceInput!) { registerDevice(registerDevice: $input) { grant { grantType assertion } } }', 224 | variables: { 225 | input: { 226 | applicationRuntime: 'chrome', 227 | attributes: { 228 | browserName: 'chrome', 229 | browserVersion: '94.0.4606', 230 | manufacturer: 'apple', 231 | model: null, 232 | operatingSystem: 'macintosh', 233 | operatingSystemVersion: '10.15.7', 234 | osDeviceIds: [], 235 | }, 236 | deviceFamily: 'browser', 237 | deviceLanguage: 'en', 238 | deviceProfile: 'macosx', 239 | }, 240 | }, 241 | }), 242 | } 243 | 244 | $httpClient.post(opts, function (error, response, data) { 245 | if (error) { 246 | reject('Error') 247 | return 248 | } 249 | 250 | if (response.status !== 200) { 251 | console.log('getLocationInfo: ' + data) 252 | reject('Not Available') 253 | return 254 | } 255 | 256 | data = JSON.parse(data) 257 | if(data?.errors){ 258 | console.log('getLocationInfo: ' + data) 259 | reject('Not Available') 260 | return 261 | } 262 | 263 | let { 264 | token: { accessToken }, 265 | session: { 266 | inSupportedLocation, 267 | location: { countryCode }, 268 | }, 269 | } = data?.extensions?.sdk 270 | resolve({ inSupportedLocation, countryCode, accessToken }) 271 | }) 272 | }) 273 | } 274 | 275 | function testHomePage() { 276 | return new Promise((resolve, reject) => { 277 | let opts = { 278 | url: 'https://www.disneyplus.com/', 279 | headers: { 280 | 'Accept-Language': 'en', 281 | 'User-Agent': UA, 282 | }, 283 | } 284 | 285 | $httpClient.get(opts, function (error, response, data) { 286 | if (error) { 287 | reject('Error') 288 | return 289 | } 290 | if (response.status !== 200 || data.indexOf('unavailable') !== -1) { 291 | reject('Not Available') 292 | return 293 | } 294 | 295 | let match = data.match(/Region: ([A-Za-z]{2})[\s\S]*?CNBL: ([12])/) 296 | if (!match) { 297 | resolve({ region: '', cnbl: '' }) 298 | return 299 | } 300 | 301 | let region = match[1] 302 | let cnbl = match[2] 303 | resolve({ region, cnbl }) 304 | }) 305 | }) 306 | } 307 | 308 | function timeout(delay = 5000) { 309 | return new Promise((resolve, reject) => { 310 | setTimeout(() => { 311 | reject('Timeout') 312 | }, delay) 313 | }) 314 | } -------------------------------------------------------------------------------- /platforms/boxjs/chiupam.boxjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "chiupam.sub", 3 | "name": "chiupam 脚本订阅", 4 | "author": "@chiupam", 5 | "icon": "https://raw.githubusercontent.com/chiupam/surge/main/platforms/boxjs/chiupam.jpg", 6 | "repo": "https://github.com/chiupam/surge", 7 | "apps": [ 8 | { 9 | "id": "Procuratorate", 10 | "name": "工作打卡", 11 | "key": [], 12 | "descs_html": [ 13 | "