feat: 脚本链接叠加参数调整

This commit is contained in:
xream 2025-03-27 12:52:19 +08:00
parent e2011de69e
commit 4d27e5bdac
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 9 additions and 7 deletions

View File

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

View File

@ -114,12 +114,7 @@ async function processFn(
if (item.type.indexOf('Script') !== -1) {
const { mode, content } = item.args;
if (mode === 'link') {
let noCache;
let url = content || '';
if (url.endsWith('#noCache')) {
url = url.replace(/#noCache$/, '');
noCache = true;
}
// extract link arguments
const rawArgs = url.split('#');
if (rawArgs.length > 1) {
@ -138,7 +133,14 @@ async function processFn(
}
}
}
url = `${url.split('#')[0]}${noCache ? '#noCache' : ''}`;
url = `${url.split('#')[0]}${
rawArgs[2]
? `#${rawArgs[2]}`
: $arguments?.noCache != null ||
$arguments?.insecure != null
? `#${rawArgs[1]}`
: ''
}`;
const downloadUrlMatch = url.match(
/^\/api\/(file|module)\/(.+)/,
);