2021-04-28 14:23:26 +08:00
|
|
|
|
/**************************
|
2020-10-10 00:35:17 +08:00
|
|
|
|
|
2021-04-28 14:23:26 +08:00
|
|
|
|
哔哩哔哩, 港澳台番剧自动切换地区 & 显示豆瓣评分
|
2020-10-10 00:35:17 +08:00
|
|
|
|
|
2021-05-01 09:14:01 +08:00
|
|
|
|
如需禁用豆瓣评分或策略通知, 可前往BoxJs设置.
|
2021-04-28 14:23:26 +08:00
|
|
|
|
BoxJs订阅地址: https://raw.githubusercontent.com/NobyDa/Script/master/NobyDa_BoxJs.json
|
2020-10-10 00:35:17 +08:00
|
|
|
|
|
2021-06-17 21:17:25 +08:00
|
|
|
|
Update: 2021.06.17
|
2020-10-10 00:35:17 +08:00
|
|
|
|
Author: @NobyDa
|
2021-04-28 14:23:26 +08:00
|
|
|
|
Use: Surge, QuanX, Loon
|
2020-10-10 00:35:17 +08:00
|
|
|
|
|
|
|
|
|
****************************
|
2021-04-28 14:23:26 +08:00
|
|
|
|
港澳台自动切换地区说明 :
|
|
|
|
|
****************************
|
|
|
|
|
|
2021-05-01 09:14:01 +08:00
|
|
|
|
地区自动切换功能仅适用于Surge4.7+(iOS),Loon2.1.10(286)+,QuanX1.0.22(543)+
|
|
|
|
|
低于以上版本仅显示豆瓣评分.
|
2021-04-28 14:23:26 +08:00
|
|
|
|
|
2021-05-01 09:14:01 +08:00
|
|
|
|
您需要配置相关规则集:
|
|
|
|
|
Surge、Loon:
|
|
|
|
|
https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/StreamingMedia/StreamingSE.list
|
|
|
|
|
|
|
|
|
|
QuanX:
|
|
|
|
|
https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/StreamingMedia/StreamingSE.list
|
|
|
|
|
|
|
|
|
|
绑定相关select或static策略组,并且需要具有相关的区域代理服务器纳入您的子策略中,子策略可以是服务器也可以是其他区域策略组.
|
2021-04-28 14:23:26 +08:00
|
|
|
|
最后,您可以通过BoxJs设置策略名和子策略名,或者手动填入脚本.
|
|
|
|
|
|
2021-05-02 21:27:25 +08:00
|
|
|
|
如需搜索指定地区番剧, 可在搜索框添加后缀" 港", " 台", " 中". 例如: 进击的巨人 港
|
|
|
|
|
|
2021-05-01 09:14:01 +08:00
|
|
|
|
QX用户注: 使用切换地区功能请确保您的QX=>其他设置=>温和策略机制处于关闭状态, 以及填写策略名和子策略名时注意大小写.
|
|
|
|
|
|
|
|
|
|
****************************
|
2021-04-28 14:23:26 +08:00
|
|
|
|
Surge 4.7+ 远程脚本配置 :
|
2020-10-10 00:35:17 +08:00
|
|
|
|
****************************
|
|
|
|
|
[Script]
|
2021-04-28 14:23:26 +08:00
|
|
|
|
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,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Bili_Auto_Regions.js
|
2020-10-10 00:35:17 +08:00
|
|
|
|
|
2021-05-02 21:27:25 +08:00
|
|
|
|
#可选, 适用于搜索指定地区的番剧
|
2021-05-02 22:07:40 +08:00
|
|
|
|
Bili Search = type=http-request,pattern=^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
|
2021-05-02 21:27:25 +08:00
|
|
|
|
|
2020-10-10 00:35:17 +08:00
|
|
|
|
[MITM]
|
2021-02-07 18:16:23 +08:00
|
|
|
|
hostname = ap?.bilibili.com
|
2021-04-28 14:23:26 +08:00
|
|
|
|
|
2020-10-10 00:35:17 +08:00
|
|
|
|
****************************
|
2021-04-28 14:23:26 +08:00
|
|
|
|
Quantumult X 远程脚本配置 :
|
|
|
|
|
****************************
|
|
|
|
|
[rewrite_local]
|
|
|
|
|
^https:\/\/ap(p|i)\.bilibili\.com\/(pgc\/view\/(v\d\/)?app|x(\/v\d)?\/view\/video)\/(season|online)\?access_key url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Bili_Auto_Regions.js
|
|
|
|
|
|
2021-05-02 21:27:25 +08:00
|
|
|
|
#可选, 适用于搜索指定地区的番剧
|
2021-05-02 22:07:40 +08:00
|
|
|
|
^https:\/\/app\.bilibili\.com\/x\/v\d\/search(\/type)?\?.+?%20(%E6%B8%AF|%E5%8F%B0|%E4%B8%AD)& url script-request-header https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Bili_Auto_Regions.js
|
2021-05-02 21:27:25 +08:00
|
|
|
|
|
2021-04-28 14:23:26 +08:00
|
|
|
|
[mitm]
|
|
|
|
|
hostname = ap?.bilibili.com
|
|
|
|
|
|
|
|
|
|
[filter_local]
|
|
|
|
|
#可选, 由于qx纯tun特性, 不添加规则可能会导致脚本失效.
|
|
|
|
|
ip-cidr, 203.107.1.1/24, reject
|
|
|
|
|
|
2021-05-01 09:14:01 +08:00
|
|
|
|
****************************
|
|
|
|
|
Loon 远程脚本配置 :
|
|
|
|
|
****************************
|
|
|
|
|
[Script]
|
|
|
|
|
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, tag=bili自动地区
|
|
|
|
|
|
2021-05-02 21:27:25 +08:00
|
|
|
|
#可选, 适用于搜索指定地区的番剧
|
2021-05-02 22:07:40 +08:00
|
|
|
|
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, tag=bili自动地区(搜索)
|
2021-05-02 21:27:25 +08:00
|
|
|
|
|
2021-05-01 09:14:01 +08:00
|
|
|
|
[Mitm]
|
|
|
|
|
hostname = ap?.bilibili.com
|
|
|
|
|
|
2021-04-28 14:23:26 +08:00
|
|
|
|
***************************/
|
|
|
|
|
|
2021-05-01 09:14:01 +08:00
|
|
|
|
let $ = nobyda();
|
2021-05-02 21:27:25 +08:00
|
|
|
|
let run = EnvInfo();
|
2021-04-28 14:23:26 +08:00
|
|
|
|
|
2021-05-02 21:27:25 +08:00
|
|
|
|
async function SwitchRegion(play) {
|
2021-04-28 14:23:26 +08:00
|
|
|
|
const Group = $.read('BiliArea_Policy') || '📺 DomesticMedia'; //Your blibli policy group name.
|
|
|
|
|
const CN = $.read('BiliArea_CN') || 'DIRECT'; //Your China sub-policy name.
|
|
|
|
|
const TW = $.read('BiliArea_TW') || '🇹🇼 sub-policy'; //Your Taiwan sub-policy name.
|
|
|
|
|
const HK = $.read('BiliArea_HK') || '🇭🇰 sub-policy'; //Your HongKong sub-policy name.
|
2021-06-17 21:17:25 +08:00
|
|
|
|
const current = await $.getPolicy(Group);
|
2021-04-28 14:23:26 +08:00
|
|
|
|
const area = (() => {
|
2021-05-02 21:27:25 +08:00
|
|
|
|
if (/\u50c5[\u4e00-\u9fa5]+\u6e2f|%20%E6%B8%AF&/.test(play)) {
|
2021-04-28 14:23:26 +08:00
|
|
|
|
if (current != HK) return HK;
|
2021-05-02 21:27:25 +08:00
|
|
|
|
} else if (/\u50c5[\u4e00-\u9fa5]+\u53f0|%20%E5%8F%B0&/.test(play)) {
|
2021-04-28 14:23:26 +08:00
|
|
|
|
if (current != TW) return TW;
|
|
|
|
|
} else if (current != CN) return CN;
|
|
|
|
|
})()
|
|
|
|
|
|
|
|
|
|
if (area) {
|
|
|
|
|
const change = await $.setPolicy(Group, area);
|
|
|
|
|
const notify = $.read('BiliAreaNotify') === 'true';
|
2021-06-17 21:17:25 +08:00
|
|
|
|
const msg = SwitchStatus(change, current, area);
|
|
|
|
|
if (!notify) {
|
|
|
|
|
$.notify(/^http/.test(play) || !play ? `` : play, ``, msg);
|
|
|
|
|
} else {
|
|
|
|
|
console.log(`${/^http/.test(play)||!play?``:play}\n${msg}`);
|
|
|
|
|
}
|
|
|
|
|
if (change) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2021-05-02 21:27:25 +08:00
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-17 21:17:25 +08:00
|
|
|
|
function SwitchStatus(status, original, newPolicy) {
|
|
|
|
|
if (status) {
|
|
|
|
|
return `${original} => ${newPolicy} => 🟢`;
|
|
|
|
|
} else if (original === 2) {
|
|
|
|
|
return `切换失败, 策略组名未填写或填写有误 ⚠️`
|
|
|
|
|
} else if (original === 3) {
|
|
|
|
|
return `切换失败, 不支持您的VPN应用版本 ⚠️`
|
|
|
|
|
} else if (status === 0) {
|
|
|
|
|
return `切换失败, 子策略名未填写或填写有误 ⚠️`
|
|
|
|
|
} else {
|
|
|
|
|
return `策略切换失败, 未知错误 ⚠️`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-02 21:27:25 +08:00
|
|
|
|
function EnvInfo() {
|
|
|
|
|
if (typeof($response) !== 'undefined') {
|
|
|
|
|
const raw = JSON.parse($response.body);
|
|
|
|
|
const data = raw.data || raw.result || {};
|
|
|
|
|
//if surge or loon, $done() will auto reconnect with the new policy
|
|
|
|
|
SwitchRegion(data.title)
|
|
|
|
|
.then(s => s && !$.isQuanX ? $done() : QueryRating(raw, data));
|
2020-10-10 00:35:17 +08:00
|
|
|
|
} else {
|
2021-05-02 21:27:25 +08:00
|
|
|
|
const raw = $request.url;
|
|
|
|
|
const res = {
|
|
|
|
|
url: raw.replace(/%20(%E6%B8%AF|%E5%8F%B0|%E4%B8%AD)&/g, '&')
|
|
|
|
|
};
|
|
|
|
|
SwitchRegion(raw).then(() => $done(res));
|
2021-04-28 14:23:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-02 21:27:25 +08:00
|
|
|
|
async function QueryRating(body, play) {
|
2021-04-28 14:23:26 +08:00
|
|
|
|
try {
|
|
|
|
|
const ratingEnabled = $.read('BiliDoubanRating') === 'false';
|
|
|
|
|
if (!ratingEnabled && play.title && body.data && body.data.badge_info) {
|
|
|
|
|
const [t1, t2] = await Promise.all([
|
|
|
|
|
GetRawInfo(play.title),
|
|
|
|
|
GetRawInfo(play.origin_name)
|
|
|
|
|
]);
|
|
|
|
|
const exYear = body.data.publish.release_date_show.split(/^(\d{4})/)[1];
|
|
|
|
|
const filterInfo = [play.title, play.origin_name, play.staff.info + play.actor.info, exYear];
|
|
|
|
|
const [rating, folk, name, id, other] = ExtractMovieInfo([...t1, ...t2], filterInfo);
|
2021-05-01 12:25:19 +08:00
|
|
|
|
const limit = JSON.stringify(body.data.modules)
|
|
|
|
|
.replace(/"\u53d7\u9650"/g, `""`).replace(/("area_limit":)1/g, '$10');
|
|
|
|
|
body.data.modules = JSON.parse(limit);
|
2021-04-28 14:23:26 +08:00
|
|
|
|
body.data.detail = body.data.new_ep.desc.replace(/连载中,/, '');
|
|
|
|
|
body.data.badge_info.text = `⭐️ 豆瓣:${!$.is403?`${rating||'无评'}分 (${folk||'无评价'})`:`查询频繁!`}`;
|
|
|
|
|
body.data.evaluate = `${body.data.evaluate||''}\n\n豆瓣评分搜索结果: ${JSON.stringify(other,0,1)}`;
|
|
|
|
|
body.data.new_ep.desc = name;
|
|
|
|
|
body.data.styles.unshift({
|
|
|
|
|
name: "⭐️ 点击此处打开豆瓣剧集详情页",
|
|
|
|
|
url: `https://m.douban.com/${id?`movie/subject/${id}/`:`search/?query=${encodeURI(play.title)}`}`
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.log(`Douban rating: \n${err}\n`);
|
|
|
|
|
} finally {
|
|
|
|
|
$done({
|
|
|
|
|
body: JSON.stringify(body)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ExtractMovieInfo(ret, fv) {
|
|
|
|
|
const sole = new Set(ret.map(s => JSON.stringify(s))); //delete duplicate
|
|
|
|
|
const f1 = [...sole].map(p => JSON.parse(p))
|
|
|
|
|
.filter(t => {
|
|
|
|
|
t.accuracy = 0;
|
|
|
|
|
if (t.name && fv[0]) { //title
|
|
|
|
|
if (t.name.includes(fv[0].slice(0, 4))) t.accuracy++;
|
|
|
|
|
if (t.name.includes(fv[0].slice(-3))) t.accuracy++;
|
|
|
|
|
}
|
|
|
|
|
if (t.origin && fv[1]) { //origin title
|
|
|
|
|
if (t.origin.includes(fv[1].slice(0, 4))) t.accuracy++;
|
|
|
|
|
if (t.origin.includes(fv[1].slice(-3))) t.accuracy++;
|
|
|
|
|
}
|
|
|
|
|
if (t.pd && fv[2]) { //producer or actor
|
|
|
|
|
const len = t.pd.split('/').filter(c => fv[2].includes(c));
|
|
|
|
|
t.accuracy += len.length;
|
|
|
|
|
}
|
|
|
|
|
if (t.year && fv[3] && t.year == fv[3]) t.accuracy++; //year
|
|
|
|
|
return Boolean(t.accuracy);
|
|
|
|
|
});
|
|
|
|
|
let x = {}; //assign most similar
|
2021-05-01 09:14:01 +08:00
|
|
|
|
const f2 = f1.reduce((p, c) => c.accuracy > p ? (x = c, c.accuracy) : p, 0);
|
2021-04-28 14:23:26 +08:00
|
|
|
|
return [x.rating, x.folk, x.name, x.id, f1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function GetRawInfo(t) {
|
|
|
|
|
let res = [];
|
|
|
|
|
let st = Date.now();
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
if (!t) return resolve(res);
|
|
|
|
|
$.get({
|
|
|
|
|
url: `https://www.douban.com/search?cat=1002&q=${encodeURIComponent(t)}`,
|
|
|
|
|
headers: {
|
|
|
|
|
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15',
|
|
|
|
|
'Cookie': JSON.stringify(st)
|
|
|
|
|
}
|
|
|
|
|
}, (error, resp, data) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.log(`Douban rating: \n${t}\nRequest error: ${error}\n`);
|
|
|
|
|
} else {
|
2021-05-01 09:14:01 +08:00
|
|
|
|
if (/\u767b\u5f55<\/a>\u540e\u91cd\u8bd5\u3002/.test(data)) $.is403 = true;
|
2021-04-28 14:23:26 +08:00
|
|
|
|
let s = data.replace(/\n| |&#\d{2}/g, '')
|
|
|
|
|
.match(/\[\u7535\u5f71\].+?subject-cast\">.+?<\/span>/g) || [];
|
|
|
|
|
for (let i = 0; i < s.length; i++) {
|
|
|
|
|
res.push({
|
|
|
|
|
name: s[i].split(/\}\)">(.+?)<\/a>/)[1],
|
|
|
|
|
origin: s[i].split(/\u540d:(.+?)(\/|<)/)[1],
|
|
|
|
|
pd: s[i].split(/\u539f\u540d.+?\/(.+?)\/\d+<\/span>$/)[1],
|
|
|
|
|
rating: s[i].split(/">(\d\.\d)</)[1],
|
|
|
|
|
folk: s[i].split(/(\d+\u4eba\u8bc4\u4ef7)/)[1],
|
|
|
|
|
id: s[i].split(/sid:(\d+)/)[1],
|
|
|
|
|
year: s[i].split(/(\d+)<\/span>$/)[1]
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let et = ((Date.now() - st) / 1000).toFixed(2);
|
|
|
|
|
console.log(`Douban rating: \n${t}\n${res.length} movie info searched. (${et} s)\n`);
|
|
|
|
|
}
|
|
|
|
|
resolve(res);
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function nobyda() {
|
|
|
|
|
const isHTTP = typeof $httpClient != "undefined";
|
|
|
|
|
const isLoon = typeof $loon != "undefined";
|
|
|
|
|
const isQuanX = typeof $task != "undefined";
|
|
|
|
|
const isSurge = typeof $network != "undefined" && typeof $script != "undefined";
|
|
|
|
|
const notify = (title, subtitle, message) => {
|
|
|
|
|
console.log(`${title}\n${subtitle}\n${message}`);
|
|
|
|
|
if (isQuanX) $notify(title, subtitle, message);
|
|
|
|
|
if (isHTTP) $notification.post(title, subtitle, message);
|
|
|
|
|
}
|
|
|
|
|
const read = (key) => {
|
|
|
|
|
if (isQuanX) return $prefs.valueForKey(key);
|
|
|
|
|
if (isHTTP) return $persistentStore.read(key);
|
|
|
|
|
}
|
|
|
|
|
const adapterStatus = (response) => {
|
|
|
|
|
if (!response) return null;
|
|
|
|
|
if (response.status) {
|
|
|
|
|
response["statusCode"] = response.status;
|
|
|
|
|
} else if (response.statusCode) {
|
|
|
|
|
response["status"] = response.statusCode;
|
|
|
|
|
}
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
const getPolicy = (groupName) => {
|
|
|
|
|
if (isSurge) {
|
2021-06-17 21:17:25 +08:00
|
|
|
|
if (typeof($httpAPI) === 'undefined') return 3;
|
2021-04-28 14:23:26 +08:00
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
$httpAPI("GET", "v1/policy_groups/select", {
|
|
|
|
|
group_name: encodeURIComponent(groupName)
|
2021-06-17 21:17:25 +08:00
|
|
|
|
}, (b) => resolve(b.policy || 2))
|
2021-04-28 14:23:26 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (isLoon) {
|
2021-06-17 21:17:25 +08:00
|
|
|
|
if (typeof($config.getPolicy) === 'undefined') return 3;
|
2021-05-01 09:14:01 +08:00
|
|
|
|
const getName = $config.getPolicy(groupName);
|
2021-06-17 21:17:25 +08:00
|
|
|
|
return getName || 2;
|
2021-05-01 09:14:01 +08:00
|
|
|
|
}
|
|
|
|
|
if (isQuanX) {
|
2021-06-17 21:17:25 +08:00
|
|
|
|
if (typeof($configuration) === 'undefined') return 3;
|
2021-05-01 09:14:01 +08:00
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
$configuration.sendMessage({
|
|
|
|
|
action: "get_policy_state"
|
|
|
|
|
}).then(b => {
|
|
|
|
|
if (b.ret && b.ret[groupName]) {
|
|
|
|
|
resolve(b.ret[groupName][1]);
|
2021-06-17 21:17:25 +08:00
|
|
|
|
} else resolve(2);
|
2021-05-01 09:14:01 +08:00
|
|
|
|
}, () => resolve());
|
|
|
|
|
})
|
2021-04-28 14:23:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const setPolicy = (group, policy) => {
|
|
|
|
|
if (isSurge && typeof($httpAPI) !== 'undefined') {
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
$httpAPI("POST", "v1/policy_groups/select", {
|
|
|
|
|
group_name: group,
|
|
|
|
|
policy: policy
|
2021-06-17 21:17:25 +08:00
|
|
|
|
}, (b) => resolve(!b.error || 0))
|
2021-04-28 14:23:26 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
2021-05-01 09:14:01 +08:00
|
|
|
|
if (isLoon && typeof($config.getPolicy) !== 'undefined') {
|
2021-04-28 14:23:26 +08:00
|
|
|
|
const set = $config.setSelectPolicy(group, policy);
|
2021-06-17 21:17:25 +08:00
|
|
|
|
return set || 0;
|
2021-05-01 09:14:01 +08:00
|
|
|
|
}
|
|
|
|
|
if (isQuanX && typeof($configuration) !== 'undefined') {
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
$configuration.sendMessage({
|
|
|
|
|
action: "set_policy_state",
|
|
|
|
|
content: {
|
|
|
|
|
[group]: policy
|
|
|
|
|
}
|
2021-06-17 21:17:25 +08:00
|
|
|
|
}).then((b) => resolve(!b.error || 0), () => resolve());
|
2021-05-01 09:14:01 +08:00
|
|
|
|
})
|
2021-04-28 14:23:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const get = (options, callback) => {
|
|
|
|
|
if (isQuanX) {
|
|
|
|
|
options["method"] = "GET";
|
|
|
|
|
$task.fetch(options).then(response => {
|
|
|
|
|
callback(null, adapterStatus(response), response.body)
|
|
|
|
|
}, reason => callback(reason.error, null, null))
|
|
|
|
|
}
|
|
|
|
|
if (isHTTP) {
|
|
|
|
|
if (isSurge) options.headers['X-Surge-Skip-Scripting'] = false;
|
|
|
|
|
$httpClient.get(options, (error, response, body) => {
|
|
|
|
|
callback(error, adapterStatus(response), body)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return {
|
|
|
|
|
getPolicy,
|
|
|
|
|
setPolicy,
|
|
|
|
|
isSurge,
|
2021-05-01 09:14:01 +08:00
|
|
|
|
isQuanX,
|
2021-04-28 14:23:26 +08:00
|
|
|
|
isLoon,
|
|
|
|
|
notify,
|
|
|
|
|
read,
|
|
|
|
|
get
|
2020-10-10 00:35:17 +08:00
|
|
|
|
}
|
|
|
|
|
}
|