From 91174c9e8c773954076f4aadf1ed1b46b7449fe3 Mon Sep 17 00:00:00 2001 From: Toperlock <861705708@qq.com> Date: Sat, 20 Jan 2024 12:37:41 +0800 Subject: [PATCH] modify instructions for use --- README.md | 4 ++-- instructions/README.md | 36 +++++++++++++++++++++--------------- main.py | 2 ++ templates/index.html | 14 +++++++------- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index d28551179..367aaecd2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # 操作说明去看[英文文档](https://github.com/Toperlock/sing-box-subscribe/blob/main/instructions/README.md),中文文档操作说明不再提供 -### sing-box 1.8.0+ 已发布,配置需要修改。已上传rule_set模板,并且默认生成最新配置文件适配 sing-box 1.8.0。用旧版singbox请选择`config_template_groups_tun.json`模板 +### sing-box 1.8.0+ 已发布,配置需要修改。已上传rule_set模板,并且默认生成最新配置文件适配 sing-box 1.8.0。~~用旧版singbox请选择`config_template_groups_tun.json`模板~~(已删除旧版配置模板) -### 使用 `/config/URL` 可以后面添加 `/&file=2` 参数选择 `config_template_groups_tun.json` 模板。两条订阅的形式也可以后面加 `/&file=2` 参数 +### 使用 `/config/URL` 可以后面添加 `/&file=2` 参数选择 `config_template_groups_v6_rule_set_tun` 模板。两条订阅的形式也可以后面加 `/&file=2` 参数 ### 根据已有的qx,surge,loon,clash规则列表自定义规则集[https://github.com/Toperlock/sing-box-geosite](https://github.com/Toperlock/sing-box-geosite) diff --git a/instructions/README.md b/instructions/README.md index 10b00dde9..cb3ac5e33 100644 --- a/instructions/README.md +++ b/instructions/README.md @@ -6,9 +6,9 @@ It is not suitable for people who are completely unfamiliar with the sing-box co Please refer to: [http://sing-box.sagernet.org/configuration](http://sing-box.sagernet.org/configuration/). -## The SSR protocol script is not parsed by default. If the subscription link contains the SSR protocol, an error will be reported. +**The SSR protocol script is not parsed by default. If the subscription link contains the SSR protocol, an error will be reported!!!** -## The upper limit of the vecel server's processing time is 10 seconds. If the clash file is too large, it will fail due to processing timeout. +**The upper limit of the vecel server's processing time is 10 seconds. If the clash file is too large, it will fail due to processing timeout!!!** ## Feature @@ -21,7 +21,7 @@ For example, the website I built [https://sing-box-subscribe.vercel.app](https:/ > Enter a link in this format in sing-box, you may need to add `url=` in front of `URL_LINK` ``` -https://xxxxxxx.vercel.app/config/url=https://xxxxxxsubscribe?token=123456/&file=https://github.com/Toperlock/sing-box-subscribe/raw/main/config_template/config_template_groups_tun.json +https://xxxxxxx.vercel.app/config/url=https://xxxxxxsubscribe?token=123456/&file=https://github.com/Toperlock/sing-box-subscribe/raw/main/config_template/config_template_groups_rule_set_tun.json ``` ### 2023.10.26 Update: Support adding `emoji`, `tag`, `prefix`, `ua`, `file` parameters after the link. Use `&` to connect multiple parameters. The usage is the same as the parameters in `providers.json` @@ -30,7 +30,7 @@ https://xxxxxxx.vercel.app/config/url=https://xxxxxxsubscribe?token=123456/&file The above example shows: enable emoji, add ♥ before the node name, use v2rayng user agent, and use `https://xxxxxxxxx.json` as the generated sing-box configuration template -Example: https://sing-box-subscribe.vercel.app/config/https://gist.githubusercontent.com/Toperlock/b1ca381c32820e8c79669cbbd85b68ac/raw/dafae92fbe48ff36dae6e5172caa1cfd7914cda4/gistfile1.txt/&file=https://github.com/Toperlock/sing-box-subscribe/raw/main/config_template/config_template_groups_tun.json +Example: https://sing-box-subscribe.vercel.app/config/https://gist.githubusercontent.com/Toperlock/b1ca381c32820e8c79669cbbd85b68ac/raw/dafae92fbe48ff36dae6e5172caa1cfd7914cda4/gistfile1.txt/&file=https://github.com/Toperlock/sing-box-subscribe/raw/main/config_template/config_template_groups_rule_set_tun.json ### 2023.11.04 Update: Two sub links can be processed, the format is: `/config/URL encoding`, `emoji`, `tag`, `prefix`, `UA` parameters cannot be written (supports 3 sub links by 2024.1.1) @@ -46,9 +46,9 @@ Example: https://sing-box-subscribe.vercel.app/config/https%3A%2F%2Fgist.githubu Example: https://sing-box-subscribe.vercel.app/config/https://gist.githubusercontent.com/Toperlock/b1ca381c32820e8c79669cbbd85b68ac/raw/dafae92fbe48ff36dae6e5172caa1cfd7914cda4/gistfile1.txt/&file=2 -### 2023.11.30 Update: sing-box 1.8.0+ has been released, the configuration needs to be modified. The `rule_set` template has been uploaded, and the latest configuration file is generated by default to adapt to sing-box 1.8.0. If you use the old version of sing-box, please choose the `config_template_groups_tun.json` template. +### 2023.11.30 Update: sing-box 1.8.0+ has been released, the configuration needs to be modified. The `rule_set` template has been uploaded, and the latest configuration file is generated by default to adapt to sing-box 1.8.0. If you use the old version of sing-box, ~~please choose the `config_template_groups_tun.json` template~~.(Configurations below version 1.8 have been cancelled.) -Use `/config/URL` to add the `/&file=2` parameter to select the `config_template_groups_tun.json` template. The form of two sublinks can also be followed by the `/&file=2` parameter. +Use `/config/URL` to add the `/&file=2` parameter to select the `config_template_groups_v6_rule_set_tun.json` template. The form of two sublinks can also be followed by the `/&file=2` parameter. ### Demo video @@ -184,23 +184,29 @@ For Windows systems, it's recommended to add the commands to a batch program for Before using, make sure to edit the `providers.json` file and the `.json` template files in the `config_template` directory. -A lazy configuration `config_template_groups_tun` file is included, which allows filtering nodes based on different categories: +A lazy configuration `config_template_groups_rule_set_tun` file is included, which allows filtering nodes based on different categories: * Implement `Openai` routing rules +* Implement `Youtube` routing rules * Implement `Google` routing rules +* Implement `Github` routing rules * Implement `Telegram` routing rules * Implement `Twitter` routing rules * Implement `Facebook` routing rules -* Implement `Amazon` routing rules +* Implement `Instagram` routing rules +* Implement `Bilibili` routing rules +* Implement `Bahamut` routing rules +* Implement `Spotify` routing rules +* Implement `TikTok` routing rules +* Implement `Netflix` routing rules +* Implement `Disney+` routing rules * Implement `Apple` routing rules +* Implement `Amazon` routing rules * Implement `Microsoft` routing rules * Implement `Game` routing rules -* Implement `Bilibili` routing rules -* Implement `Youtube` routing rules -* Implement `Netflix` routing rules * Implement `Hbo` routing rules -* Implement `Disney` routing rules * Implement `Prime Video` routing rules + # providers.json File In this file, you can add subscription links and basic settings. ```json @@ -209,7 +215,7 @@ In this file, you can add subscription links and basic settings. { "url": "https://4gviet.com/api/v1/client/subscribe?token=xx", "tag": "airport1_tag", //You can keep the default without modification - "enabled": true, + "enabled": true, //Enable conversion of this link "emoji": 1, //Add flag emoji "subgroup": "", "prefix": "", //Do not add node name prefix @@ -218,7 +224,7 @@ In this file, you can add subscription links and basic settings. { "url": "https://5gtocdocao.com/api/v1/client/subscribe?token=xx", "tag": "airport2_tag", //You can keep the default without modification - "enabled": false, + "enabled": false, //Disable conversion of this link "emoji": 0, //Do not add flag emoji "subgroup": "named", //Name the subscription link "prefix": "❤️node_name prefix - ", //Add node name prefix @@ -231,7 +237,7 @@ In this file, you can add subscription links and basic settings. }, "save_config_path": "./config.json", "auto_backup": false, - "exclude_protocol": "ssr", //Not parsing ssr nodes + "exclude_protocol": "ssr", //Not parsing ssr nodes!!! "config_template": "", //Customize the correct web page json configuration template link "Only-nodes": false //Output the complete sing-box configuration } diff --git a/main.py b/main.py index 61e702d48..96515ae78 100644 --- a/main.py +++ b/main.py @@ -43,6 +43,8 @@ def process_subscribes(subscribes): for subscribe in subscribes: if 'enabled' in subscribe and not subscribe['enabled']: continue + if 'sing-box-subscribe.vercel.app' in subscribe['url']: + continue _nodes = get_nodes(subscribe['url']) if _nodes and len(_nodes) > 0: add_prefix(_nodes, subscribe) diff --git a/templates/index.html b/templates/index.html index d1a968d85..a99b81eed 100644 --- a/templates/index.html +++ b/templates/index.html @@ -81,23 +81,23 @@

Edit TEMP_JSON_DATA

-

请务必:点击查看操作说明

-

Please be sure to: Click to view operation instructions.

+

请务必:点击查看操作说明!!!

+

Please be sure to: Click to view operation instructions!!!

请务必:点击查看参数含义

Please be sure to: Click to view parameter meanings.

2024-1-10:我的vercel免费套餐容量要被你们占满了,有github账号的请fork本项目使用自己搭建的订阅转换网站,不然后续我会决定关闭此网站

前提:在此网页正确填写订阅链接,生成配置失败是因为同一时间别人也在生成配置,导致你填写的内容被复原。建议使用/config/URL的形式

-

“groups_rule_set_tun.json”模板是给 sing-box 1.8.0+ 使用的。旧版sing-box请使用其他模板

-

填写订阅地址在引号 “” 内,注意订阅地址末尾不要有换行,这很容易被忽视!!!(为什么很喜欢填到enable为false的url里面?why????)

+

“groups_rule_set_tun.json”模板是给 sing-box 1.8.0+ 使用的。

+

填写订阅地址在引号 “” 内,注意订阅地址末尾不要有换行,这很容易被忽视!!!(为什么很喜欢填到enable为false的url里面?why????看不懂false的意思吗???)

提醒: 点击保存后请立即生成配置文件!!!

不然别人也会看到你保存的 TEMP_JSON_DATA 内容

“订阅地址”是以 "http://" 开头的【包含】节点信息的v2/clash链接或者是以 "vmess://","hysteria2://"... 之类开头的单条URI节点链接,多条URI请在每条末尾添加换行符:\n 代替换行(请你明白json写法规范),也可以填写base64内容

-

机场提供的订阅链接能直接在浏览器打开,这脚本就能使用。请你自行检查是否可以。已屏蔽gitlab链接。不看说明的傻逼玩意

+

机场提供的订阅链接能直接在浏览器打开,这脚本就能使用。请你自行检查是否可以。如果浏览器能打开订阅,但还是转换失败请你放弃使用此项目

需要特殊环境才能打开的订阅链接,请你在 TEMP_JSON_DATA 修改 "User-Agent" 或者先行把机场订阅链接内容复制到gist里,脚本才会解析成功。或者本地运行脚本

-

全部都是 SSR 协议会报错,或者请删掉左边方框内 exclude_protocol 引号里面的 ssr 这个三个字符即可

+

全部都是 SSR 协议会报错,或者请删掉左边方框内 exclude_protocol 引号里面的 ssr 这个三个字符即可!!!!!!

机场订阅里有hy2新协议,请修改 "User-Agent" 为:clashmeta。球球你了,别塞文件大于1MB的clash,你只需要保留proxies字段,别写那破鸡巴规则了,vercel服务器解析超时了懂吗老弟

以上不是废话,没成功生成配置请你仔细阅读以上内容

-

因为没用数据库,不会返回配置文件链接。生成配置内容后复制到gist里当作 sing-box remote 链接

+

不看说明的都是傻逼,自以为是的大聪明

生成配置成功后请不要用第三方输入法复制内容,会有长度限制复制不全

Một số Link Tiếng Việt không hoạt động với script này, vui lòng chạy nó trên local

Video hoạt động