Fixed local subscription not working in collections

This commit is contained in:
Peng-YM 2022-05-25 22:33:54 +08:00
parent 1ac077101d
commit 51db70a1c3
4 changed files with 14 additions and 7 deletions

View File

@ -6,7 +6,7 @@
*
*
* Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket!
* @updated: 2022/5/25 下午6:14:57
* @updated: 2022/5/25 下午10:33:28
* @version: 1.6
* @author: Peng-YM
* @github: https://github.com/Peng-YM/Sub-Store

View File

@ -318,7 +318,12 @@ async function produceArtifact({ type, item, platform, noProcessor }) {
const sub = allSubs[name];
try {
$.info(`正在处理子订阅:${sub.name}...`);
const raw = await download(sub.url, sub.ua);
let raw;
if (sub.source === 'local') {
raw = sub.content;
} else {
raw = await download(sub.url, sub.ua);
}
// parse proxies
let currentProxies = ProxyUtils.parse(raw);
if (!noProcessor) {

View File

@ -35,9 +35,11 @@ async function downloadCollection(req, res) {
const subs = collection['subscriptions'];
if (subs.length > 0) {
const sub = allSubs[subs[0]];
const flowInfo = await getFlowHeaders(sub.url);
if (flowInfo) {
res.set('subscription-userinfo', flowInfo);
if (sub.source !== 'local') {
const flowInfo = await getFlowHeaders(sub.url);
if (flowInfo) {
res.set('subscription-userinfo', flowInfo);
}
}
}

File diff suppressed because one or more lines are too long