Skip to content

Commit eba921e

Browse files
committed
feat: 新增新版 Loon 3.5.0(969)及以上版本的资源解析器插件
1 parent e72a394 commit eba921e

4 files changed

Lines changed: 46 additions & 5 deletions

File tree

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.24.16",
3+
"version": "2.24.17",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"packageManager": "pnpm@11.0.9",

backend/src/products/resource-parser.loon.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
/* eslint-disable no-undef */
2+
/**
3+
* $resourceType: 解析器脚本自带全局变量,资源类型,枚举,详见下方
4+
* $resource: 解析器脚本自带全局变量,资源内容,string
5+
* $resourceUrl: 解析器脚本自带全局变量,资源url,string
6+
*
7+
* 资源类型
8+
* 0:config
9+
* 1:nodes
10+
* 2:rules
11+
* 3:rewrites
12+
* 4:scripts
13+
* 5:plugin
14+
*/
215
import { ProxyUtils } from '@/core/proxy-utils';
316
import { RuleUtils } from '@/core/rule-utils';
417
import { version } from '../../package.json';
@@ -27,9 +40,13 @@ let resourceUrl = typeof $resourceUrl !== 'undefined' ? $resourceUrl : '';
2740

2841
let arg;
2942
if (typeof $argument != 'undefined') {
30-
arg = Object.fromEntries(
31-
$argument.split('&').map((item) => item.split('=')),
32-
);
43+
if (typeof $argument === 'string') {
44+
arg = Object.fromEntries(
45+
$argument.split('&').map((item) => item.split('=')),
46+
);
47+
} else {
48+
arg = $argument;
49+
}
3350
} else {
3451
arg = {};
3552
}

config/Loon-parser.plugin

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!name=Loon 订阅解析器
2+
#!desc=专门用于解析订阅节点的插件, 需 Loon 3.5.0(969)及以上版本. 若需要完整版 Sub-Store, 请使用 Sub-Store Loon 插件
3+
#!tag=解析器,官方,Demo
4+
#!system=
5+
#!system_version=
6+
#!loon_version=3.5.0(969)
7+
#!openUrl=https://sub.store
8+
#!author=Peng-YM
9+
#!homepage=https://github.com/sub-store-org/Sub-Store
10+
#!icon=https://raw.githubusercontent.com/58xinian/icon/master/Sub-Store1.png
11+
#!type=parser
12+
13+
[Argument]
14+
resourceUrlOnly = switch,true,tag=仅使用远程资源 忽略 Loon 自身解析数据,desc=忽略 Loon 自身解析数据
15+
ua = input,"",tag=拉取订阅的 User-Agent,desc=拉取订阅的 User-Agent
16+
timeout = input,8000,tag=拉取订阅时使用的超时时间,desc=拉取订阅时使用的超时时间
17+
noCache = switch,false,tag=禁用缓存,desc=禁用缓存
18+
age-secret-key = input,"",tag=age 解密私钥,desc=age 解密私钥 可查看 https://t.me/zhetengsha/5876
19+
20+
[Script]
21+
generic script-path=https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store-parser.loon.min.js,tag=Sub-Store Parser,timeout=120,argument=[{ua},{resourceUrlOnly},{noCache},{timeout},{age-secret-key}]

config/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ SUB_STORE_CORS_ALLOWED_ORIGINS=https://sub-store.vercel.app,http://127.0.0.1:888
2828

2929
安装使用 插件 [`https://raw.githubusercontent.com/sub-store-org/Sub-Store/master/config/Loon.plugin`](https://raw.githubusercontent.com/sub-store-org/Sub-Store/master/config/Loon.plugin) 即可。
3030

31-
资源解析器中使用 [https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store-parser.loon.min.js](https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store-parser.loon.min.js)
31+
新版 Loon 3.5.0(969)及以上版本 使用资源解析器插件 [`https://raw.githubusercontent.com/sub-store-org/Sub-Store/master/config/Loon-parser.plugin`](https://raw.githubusercontent.com/sub-store-org/Sub-Store/master/config/Loon-parser.plugin)
32+
旧版 Loon 在资源解析器中使用 [https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store-parser.loon.min.js](https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store-parser.loon.min.js)
33+
34+
详见 [Loon 资源解析器说明](https://github.com/sub-store-org/Sub-Store/wiki/Loon-%E8%B5%84%E6%BA%90%E8%A7%A3%E6%9E%90%E5%99%A8%E8%AF%B4%E6%98%8E)
3235

3336
### 2. Surge
3437

0 commit comments

Comments
 (0)