Compare commits

...

3 Commits

Author SHA1 Message Date
xream
b7d7346ef7 feat: geo 增加多哥和伊拉克 2025-08-03 10:27:46 +08:00
xream
cbfe528c5e feat: 订阅流量信息中的 expire <=0 时, 视为空 2025-08-01 13:09:11 +08:00
xream
59ea2bd174 feat: 获取订阅时, 总是检查是否包含有效节点 2025-07-29 11:59:55 +08:00
4 changed files with 29 additions and 29 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.19.97",
"version": "2.19.100",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {

View File

@@ -260,37 +260,27 @@ export default async function download(
shouldCache = false;
}
}
if (preprocess) {
try {
const proxies = ProxyUtils.parse(body);
if (!Array.isArray(proxies) || proxies.length === 0) {
$.error(`URL ${url} 不包含有效节点, 不缓存`);
shouldCache = false;
}
} catch (e) {
$.error(
`URL ${url} 尝试解析节点失败 ${e.message ?? e}, 不缓存`,
);
shouldCache = false;
}
}
if (shouldCache) {
resourceCache.set(id, body);
if (customCacheKey) {
let shouldWriteCustomCacheKey = true;
if (preprocess) {
try {
const proxies = ProxyUtils.parse(body);
if (
!Array.isArray(proxies) ||
proxies.length === 0
) {
$.error(
`URL ${url} 不包含有效节点\n不写入自定义缓存 ${$arguments?.cacheKey}`,
);
shouldWriteCustomCacheKey = false;
}
} catch (e) {
$.error(
`URL ${url} 尝试解析节点失败 ${
e.message ?? e
}\n不写入自定义缓存 ${$arguments?.cacheKey}`,
);
shouldWriteCustomCacheKey = false;
}
}
if (shouldWriteCustomCacheKey) {
$.info(
`URL ${url}\n写入自定义缓存 ${$arguments?.cacheKey}`,
);
$.write(body, customCacheKey);
}
$.info(
`URL ${url}\n写入自定义缓存 ${$arguments?.cacheKey}`,
);
$.write(body, customCacheKey);
}
}

View File

@@ -342,6 +342,12 @@ export function normalizeFlowHeader(flowHeaders) {
) {
try {
decodedValue = Number(decodedValue).toFixed(0);
if (
['expire'].includes(key) &&
decodedValue <= 0
) {
decodedValue = '';
}
} catch (e) {
$.error(
`Failed to convert value for key "${key}=${encodedValue}": ${

View File

@@ -46,6 +46,7 @@ const ISOFlags = {
'🇭🇰': ['HK', 'HKG', 'HKT', 'HKBN', 'HGC', 'WTT', 'CMI'],
'🇭🇷': ['HR', 'HRV'],
'🇭🇺': ['HU', 'HUN'],
'🇮🇶': ['IQ', 'IRQ'], // 伊拉克
'🇯🇴': ['JO', 'JOR'],
'🇯🇵': ['JP', 'JPN', 'TYO'],
'🇰🇪': ['KE', 'KEN'],
@@ -99,6 +100,7 @@ const ISOFlags = {
'🇸🇬': ['SG', 'SGP'],
'🇸🇮': ['SI', 'SVN'],
'🇸🇰': ['SK', 'SVK'],
'🇹🇬': ['TG', 'TGO'], // 多哥
'🇹🇭': ['TH', 'THA'],
'🇹🇳': ['TN', 'TUN'],
'🇹🇷': ['TR', 'TUR'],
@@ -220,6 +222,7 @@ export function getFlag(name) {
],
'🇭🇷': ['Croatia', '克罗地亚', '克羅地亞'],
'🇭🇺': ['Hungary', '匈牙利'],
'🇮🇶': ['Iraq', '伊拉克', '巴格达', 'Baghdad'], // 伊拉克
'🇯🇴': ['Jordan', '约旦'],
'🇯🇵': [
'Japan',
@@ -338,6 +341,7 @@ export function getFlag(name) {
],
'🇸🇮': ['Slovenia', '斯洛文尼亚'],
'🇸🇰': ['Slovakia', '斯洛伐克'],
'🇹🇬': ['Togo', '多哥', '洛美', 'Lomé', 'Lome'], // 多哥
'🇹🇭': ['Thailand', '泰国', '泰國', '曼谷'],
'🇹🇳': ['Tunisia', '突尼斯'],
'🇹🇷': ['Turkey', '土耳其', '伊斯坦布尔', 'Istanbul'],