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 @@