Update Bili_Auto_Regions.js

This commit is contained in:
NobyDa 2021-02-07 18:16:23 +08:00
parent 8d2249d1e1
commit 7cabcbfb8e
1 changed files with 4 additions and 3 deletions

View File

@ -8,16 +8,17 @@ Bilibli番剧自动切换地区
您需要配置相关规则集https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/StreamingMedia/StreamingSE.list绑定相关select策略组并且需要具有相关的区域代理服务器纳入您的子策略中。
最后您可以通过BoxJs设置策略名和子策略名或者手动填入脚本
Update: 2021.02.07
Author: @NobyDa
****************************
Surge 4.2+ 远程脚本配置 :
****************************
[Script]
Bili Region = type=http-response,pattern=https:\/\/api\.bilibili\.com\/pgc\/view\/(v\d\/)?app\/season\?access_key,requires-body=1,max-size=0,control-api=1,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Bili_Auto_Regions.js
Bili Region = type=http-response,pattern=^https:\/\/ap(p|i)\.bilibili\.com\/(pgc\/view\/(v\d\/)?app|x(\/v\d)?\/view\/video)\/(season|online)\?access_key,requires-body=1,max-size=0,control-api=1,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Bili_Auto_Regions.js
[MITM]
hostname = api.bilibili.com
hostname = ap?.bilibili.com
****************************
*/
@ -37,7 +38,7 @@ const str = (() => {
} else if (current != CN) return CN;
})()
if (str && obj) {
if (str) {
const change = $surge.setSelectGroupPolicy(Group, str);
const notify = $persistentStore.read('BiliAreaNotify') === 'true';
if (!notify) $notification.post(obj, ``, `${current} => ${str} => ${change?`🟢`:`🔴`}`);