折腾啥 头像

消息来源频道

折腾啥

@zhetengsha

频道40,410 位成员公开可见0 人在线

Power Users/Automators 折腾/讨论/分享各种开源工具/脚本/自动化工作流 👥 群组 @zhetengsha_group 📌 资源合集导航 https://t.me/zhetengsha/2 🎁 恰饭推荐 https://t.me/zhetengsha/957 📢 广告投放 @xream Buy ads: https://telega.io/c/zhetengsha feedId:55438372655431680+userId:62307599601855488

成员规模40,410 位成员
在线情况0 人在线
消息总数4,340 条消息
浏览量总数7,753,402 次浏览

在这个频道里搜索消息……

t.me/zhetengsha

🔗 Sub-Store 文件动态生成 📦 sing-box 配置示例
🆕 查看最新版带参数规则的脚本
———
💃 亚托莉佬的模板和远程脚本
远程文件填 链接1 或 链接2
脚本操作填链接 https://raw.githubusercontent.com/xishang0128/sub-store-template/main/sing-box.js#type=1&name=name // "1" 表示组合订阅, name 为订阅的 "名称", 具体看文件中的说明
⚠️ 此脚本与此模板配套 如果要用自定义模板/有自定义脚本的需求 可使用👇🏻的方案自己动手 或者 查看最新版带参数规则的脚本
1.1 使用远程模板
远程链接 中 第一行为 sing-box 模板文件链接
例: https://a.com/sing-box.tpl.json
1.2 或者使用本地模板
本地文本 中为 sing-box 模板文件的内容
假设 你的 sing-box 模板文件中的 outbounds 是这样的: { "outbounds": [ { "tag": "全部节点", "type": "selector", "default": "urltest", "outbounds": [ "美国节点" ] }, { "tag": "美国节点", "type": "urltest", "outbounds": [] } ] }
脚本操作:
let config = (ProxyUtils.JSON5 || JSON).parse($content ?? $files[0]) // 文件中的第一个
let proxies = await produceArtifact({
type: 'subscription', // 如果是组合订阅 就是 'collection'
name: '订阅的name', // 订阅的"名称", 不是"显示名称"
platform: 'sing-box',
produceType: 'internal'
})
// 先将全部节点结构插到 outbounds
config.outbounds.push(...proxies)
config.outbounds.map(i => {
// 在 全部节点 中插入全部节点名
if (['全部节点'].includes(i.tag)) {
i.outbounds.push(...proxies.map(p => p.tag))
}
// 在 美国节点 中插入全部美国节点名
if (['美国节点'].includes(i.tag)) {
i.outbounds.push(...proxies.filter(p => /美国|🇺🇸|us|united states/i.test(p.tag)).map(p => p.tag))
}
})
$content = JSON.stringify(config, null, 2)
▎其他示例(YAML, JSON):
let singboxProxies = await produceArtifact({
type: 'subscription', // type: 'subscription' 或 'collection'
name: 'sub', // subscription name
platform: 'sing-box', // target platform
produceType: 'internal' // 'internal' produces an Array, otherwise produces a String( JSON.parse('JSON String') )
})
let clashMetaProxies = await produceArtifact({
type: 'subscription',
name: 'sub',
platform: 'ClashMeta',
produceType: 'internal' // 'internal' produces an Array, otherwise produces a String( ProxyUtils.yaml.safeLoad('YAML String').proxies )
}))
// YAML
$content = ProxyUtils.yaml.safeDump({})
// JSON
$content = JSON.stringify({}, null, 2)
🎲 Sub-Store 代理 App 版安装下载
🛠 Sub-Store 服务器/云平台/Docker/Android 版的相关教程