diff --git a/backend/package.json b/backend/package.json index 38ef082..fb1a067 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.19.40", + "version": "2.19.41", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/restful/file.js b/backend/src/restful/file.js index 1744f5e..4423ac3 100644 --- a/backend/src/restful/file.js +++ b/backend/src/restful/file.js @@ -64,6 +64,7 @@ async function getFile(req, res) { ignoreFailedRemoteFile, proxy, noCache, + produceType, } = req.query; let $options = { _req: { @@ -128,6 +129,10 @@ async function getFile(req, res) { if (noCache) { $.info(`指定不使用缓存: ${noCache}`); } + if (produceType) { + produceType = decodeURIComponent(produceType); + $.info(`指定生产类型: ${produceType}`); + } const allFiles = $.read(FILES_KEY); const file = findByName(allFiles, name); @@ -144,6 +149,7 @@ async function getFile(req, res) { $options, proxy, noCache, + produceType, }); try { diff --git a/backend/src/restful/sync.js b/backend/src/restful/sync.js index 899e52d..4a55914 100644 --- a/backend/src/restful/sync.js +++ b/backend/src/restful/sync.js @@ -173,6 +173,9 @@ async function produceArtifact({ raw.push(sub.content); } } + if (produceType === 'raw') { + return (Array.isArray(raw) ? raw : [raw]).flat(); + } // parse proxies let proxies = (Array.isArray(raw) ? raw : [raw]) .map((i) => ProxyUtils.parse(i)) @@ -570,6 +573,9 @@ async function produceArtifact({ } } } + if (produceType === 'raw') { + return (Array.isArray(raw) ? raw : [raw]).flat(); + } const files = (Array.isArray(raw) ? raw : [raw]).flat(); let filesContent = files .filter((i) => i != null && i !== '')