An open API service indexing awesome lists of open source software.

https://github.com/fordes123/ad-filters-subscriber

广告过滤规则订阅器,整合不同来源的规则,帮助你快速构建属于自己的规则集
https://github.com/fordes123/ad-filters-subscriber

adblock adblock-list adblocker-lists adguard-blocklist adguard-home adguard-home-blocklist adguard-list hosts ublock-origin ublock-origin-filters

Last synced: 5 months ago
JSON representation

广告过滤规则订阅器,整合不同来源的规则,帮助你快速构建属于自己的规则集

Awesome Lists containing this project

README

          


AD Filter Subscriber



广告过滤规则订阅器,整合不同来源的规则,帮助你快速构建属于自己的规则集~


last update
forks
stars
open issues
license


项目说明
·
快速开始
·
规则订阅
·
问题反馈


[English](./README_en.md) | 中文

📔 项目说明

本项目旨在聚合不同来源、不同格式的广告过滤规则,自由的进行转换和整合。
> ⚠️ 新版不再兼容原配置格式,迁移前务必注意
#### 支持的规则格式
- [x] easylist
- [x] dnsmasq
- [x] clash
- [x] smartdns
- [x] hosts

#### 注意事项
1. 仅支持基本规则转换,即域名、通配域名构成的规则,对形如 `||example.org^$popup` 等规则无法转换(合并、去重不受影响)
2. 接受不可避免的缩限,如 `||example.org^` 将拦截 example.org 及其所有子域,但将其转换为 hosts 格式时,将无法匹配子域名。
3. 规则有效性检测基于域名解析,因此仅支持基本规则。

🛠️ 快速开始

### 示例配置

```yaml
application:
rule:
#远程规则订阅,path为 http、https地址
remote:
- name: 'Subscription 1' #可选参数: 规则名称,如无将使用 path 作为名称
path: 'https://example.org/rule.txt' #必要参数: 规则url,仅支持 http/https,不限定响应内容格式
type: easylist #可选参数: 规则类型:easylist (默认)、dnsmasq、clash、smartdns、hosts

#本地规则,path为 操作系统支持的绝对或相对路径
local:
- name: 'private rule'
path: '/rule/private.txt'

output:
#文件头配置,将自动作为注释添加至每个规则文件开始
#可使用占位符 ${name}、${type}、${desc} 以及 ${date} (当前日期)
file_header: |
ADFS Adblock List
Title: ${name}
Last Modified: ${date}
Homepage: https://github.com/fordes123/ad-filters-subscriber/
files:
- name: easylist.txt #必要参数: 文件名
type: EASYLIST #必要参数: 文件类型: easylist、dnsmasq、clash、smartdns、hosts
desc: 'ADFS EasyList' #可选参数: 文件描述,可在file_header中通过 ${} 中使用
filter: #可选参数: 包含规则的类型,默认全选
- basic #基本规则,不包含任何控制、匹配符号, 可以转换为 hosts
- wildcard #通配规则,仅使用通配符
- unknown #其他规则,如使用了正则、高级修饰符号等,这表示目前无法支持
```

---
本程序基于 `Java21` 编写,使用 `Maven` 进行构建,你可以参照[示例配置](./config/application-example.yaml),编辑 `config/application.yaml`
,并通过以下任意一种方式快速开始:

#### **本地调试**

```bash
git clone https://github.com/fordes123/ad-filters-subscriber.git
cd ad-filters-subscriber
mvn clean
mvn spring-boot:run
```

#### **Github Action**

- fork 本项目
- 自定义规则订阅 (可选)
- 参照[示例配置](./config/application-example.yaml),修改配置文件: `config/application.yaml`
- 打开 `Github Action` 页面,选中左侧 `Update Filters` 授权 `Workflow` 定时执行(⚠ 重要步骤)
- 点击 `Run workflow` 或等待自动执行。执行完成后规则将生成在 `release` 分支

#### **Codespaces**

- 登录 `Github`,点击本仓库右上角 `Code` 按钮,选择并创建新的 `Codespaces`
- 等待 `Codespaces` 启动,即可直接对本项目进行调试

🎯 规则订阅

**⚠ 本仓库不再提供规则订阅,我们更推荐 fork 本项目自行构建规则集.**

下面是使用了本项目进行构建的规则仓库,可在其中寻找合适的规则订阅:

点击查看

💬 问题反馈

- 👉 [issues](https://github.com/fordes123/ad-filters-subscriber/issues)