定时合并 mihomo、sing-box 规则,构建自用规则集
- 支持
yaml、mrs、text、json、srs文件格式 1 - 支持
domain、ipcidr、classical、sing-box规则格式 - 支持规则格式互转
Tip
亦可 Fork 本仓库后使用 Actions 进行自动化构建
-
安装
python以及必要依赖python -m pip install --upgrade pip pip install -r requirements.txt
-
编辑
config.yaml以列表形式定义需要生成的文件以及其上游规则,基本格式与 Mihomo rule-providers 一致- path: output/reject.yml format: yaml # options: yaml, mrs, text, json, srs behavior: classical # options: domain, ipcidr, classical, sing-box upstream: local_reject: type: http path: "local/reject.txt" format: text behavior: classical xndeye_reject: type: http url: "https://raw.githubusercontent.com/xndeye/adblock_list/refs/heads/release/clash.yaml" format: yaml behavior: domain
-
配置 Mihomo 路径 (使用
mrs格式必要条件)- 修改
rule_merger.py的MIHOMO_PATH字段 - 或将
mihomo可执行文件加入/usr/local/bin/或$PATH环境变量中
- 修改
-
配置 sing-box 路径 (使用
srs格式必要条件)- 修改
rule_merger.py的SING_BOX_PATH字段 - 或将
sing-box可执行文件加入/usr/local/bin/或$PATH环境变量中 - GitHub Actions 固定使用 sing-box
v1.13.13,默认生成 rule-set version4
- 修改
-
执行脚本
python rule_merger.py
| 文件 | 介绍 | github | ghproxy | jsdelivr |
|---|---|---|---|---|
reject |
广告域名 | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
reject@ip |
广告IP | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
direct |
推荐直连域名 | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
direct@ip |
推荐直连IP | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
microsoft@cn |
微软中国域名 | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
apple@cn |
苹果中国域名 | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
steam@cn |
Steam 中国域名 | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
ai |
AI相关域名 | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
proxy |
推荐代理域名 | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
proxy@ip |
推荐代理IP | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
lan@ip |
局域网IP | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
lan |
局域网域名 | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
fakeip-filter |
fakeIP过滤 | mrs yaml json srs | mrs yaml json srs | mrs yaml json srs |
- Sukka Ruleset
- Loyalsoldier/clash-rules
- DustinWin/domain-list-custom
- xndeye/adblock_list
- ACL4SSR/ACL4SSR
Footnotes
-
mihomo 可用格式:
yaml、mrs、text,sing-box 可用格式:json、srs↩