mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-23 00:59:06 +08:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
35dd4f31fc | ||
![]() |
fa6472b1c1 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.452",
|
"version": "2.14.453",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -11,6 +11,10 @@ import {
|
|||||||
validCheck,
|
validCheck,
|
||||||
} from '@/utils/flow';
|
} from '@/utils/flow';
|
||||||
import $ from '@/core/app';
|
import $ from '@/core/app';
|
||||||
|
import PROXY_PREPROCESSORS from '@/core/proxy-utils/preprocessors';
|
||||||
|
const clashPreprocessor = PROXY_PREPROCESSORS.find(
|
||||||
|
(processor) => processor.name === 'Clash Pre-processor',
|
||||||
|
);
|
||||||
|
|
||||||
const tasks = new Map();
|
const tasks = new Map();
|
||||||
|
|
||||||
@ -172,7 +176,7 @@ export default async function download(
|
|||||||
`Downloading...\nUser-Agent: ${userAgent}\nTimeout: ${requestTimeout}\nProxy: ${proxy}\nInsecure: ${!!insecure}\nURL: ${url}`,
|
`Downloading...\nUser-Agent: ${userAgent}\nTimeout: ${requestTimeout}\nProxy: ${proxy}\nInsecure: ${!!insecure}\nURL: ${url}`,
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
const { body, headers, statusCode } = await http.get({
|
let { body, headers, statusCode } = await http.get({
|
||||||
url,
|
url,
|
||||||
...(proxy ? { proxy } : {}),
|
...(proxy ? { proxy } : {}),
|
||||||
...(isLoon && proxy ? { node: proxy } : {}),
|
...(isLoon && proxy ? { node: proxy } : {}),
|
||||||
@ -193,6 +197,13 @@ export default async function download(
|
|||||||
}
|
}
|
||||||
if (body.replace(/\s/g, '').length === 0)
|
if (body.replace(/\s/g, '').length === 0)
|
||||||
throw new Error(new Error('远程资源内容为空'));
|
throw new Error(new Error('远程资源内容为空'));
|
||||||
|
try {
|
||||||
|
if (clashPreprocessor.test(body)) {
|
||||||
|
body = clashPreprocessor.parse(body);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.error(`Clash Pre-processor error: ${e}`);
|
||||||
|
}
|
||||||
let shouldCache = true;
|
let shouldCache = true;
|
||||||
if (cacheThreshold) {
|
if (cacheThreshold) {
|
||||||
const size = body.length / 1024;
|
const size = body.length / 1024;
|
||||||
|
@ -143,6 +143,7 @@ export function getFlag(name) {
|
|||||||
'🇧🇭': ['Bahrain', '巴林'],
|
'🇧🇭': ['Bahrain', '巴林'],
|
||||||
'🇧🇷': ['Brazil', '巴西', '圣保罗'],
|
'🇧🇷': ['Brazil', '巴西', '圣保罗'],
|
||||||
'🇧🇾': ['Belarus', '白俄罗斯', '白俄'],
|
'🇧🇾': ['Belarus', '白俄罗斯', '白俄'],
|
||||||
|
'🇧🇴': ['Bolivia', '玻利维亚'],
|
||||||
'🇨🇦': [
|
'🇨🇦': [
|
||||||
'Canada',
|
'Canada',
|
||||||
'加拿大',
|
'加拿大',
|
||||||
@ -193,6 +194,7 @@ export function getFlag(name) {
|
|||||||
],
|
],
|
||||||
'🇬🇪': ['Georgia', '格鲁吉亚', '格魯吉亞'],
|
'🇬🇪': ['Georgia', '格鲁吉亚', '格魯吉亞'],
|
||||||
'🇬🇷': ['Greece', '希腊', '希臘'],
|
'🇬🇷': ['Greece', '希腊', '希臘'],
|
||||||
|
'🇬🇹': ['Guatemala', '危地马拉'],
|
||||||
'🇭🇰': [
|
'🇭🇰': [
|
||||||
'Hongkong',
|
'Hongkong',
|
||||||
'香港',
|
'香港',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user