Ad Filter Rule Subscriber, integrating rules from various sources to help you quickly build your own rule set~
English | 中文
This project aims to aggregate ad filtering rules from different sources and in various formats, allowing for flexible conversion and integration.
⚠️ Note: The new version is not compatible with the original configuration format, so please be cautious before migrating.
- easylist
- dnsmasq
- clash
- smartdns
- hosts
- Only basic rule conversions are supported, specifically rules consisting of domain names and wildcard domains. Rules
such as
||example.org^$popup
cannot be converted (merging and deduplication are not affected). - Accept unavoidable limitations. For example,
||example.org^
will block example.org and all its subdomains, but when converted to hosts format, it will not match subdomains. - Rule validity check is based on domain resolution, so it only supports basic rules.
application:
rule:
# Remote rule subscription, path is http/https address
remote:
- name: 'Subscription 1' # Optional parameter: Rule name, if no name is provided, the path will be used as the name.
path: 'https://example.org/rule.txt' # Required parameter: Rule url. Only support http/https.
type: easylist # Optional parameter: Rule type: easylist (default)、dnsmasq、clash、smartdns、hosts
# Local rule, path is absolute or relative path
local:
- name: 'private rule'
path: '/rule/private.txt'
output:
# File header configuration, which will be automatically added as comments at the beginning of each rule file.
# You can use placeholders like ${name}, ${type}, ${desc}, and ${date} (current date).
file_header: |
ADFS Adblock List
Title: ${name}
Last Modified: ${date}
Homepage: https://github.com/fordes123/ad-filters-subscriber/
path: rule # Output rule file path. Support absolute or relative path.
files:
- name: easylist.txt # Required parameter: File name
type: EASYLIST # Required parameter: File type: easylist、dnsmasq、clash、smartdns、hosts
desc: 'ADFS EasyList' # Optional parameter: File description, which can be used within ${} in the file_header.
filter: # Optional parameter: Types of included rules, all selected by default.
- basic # Basic rules: Do not contain any control or matching symbols, can be converted to hosts.
- wildcard # Wildcard rules: Only use wildcard symbols.
- unknown # Other rules: Such as those using regex or advanced modifiers, cannot be converted at present.
This program is written in Java 21
and built using Maven
. You can refer to the example configuration,
edit src/main/resources/application.yml
, and quickly get started using any of the following methods:
git clone https://github.com/fordes123/ad-filters-subscriber.git
cd ad-filters-subscriber
mvn clean
mvn spring-boot:run
- Fork this project
- Customize rule subscriptions
- Refer to the example configuration and modify the configuration file:
src/main/resources/application.yml
- Refer to the example configuration and modify the configuration file:
- Open the GitHub Actions page, select Update Filters on the left side, and authorize the workflow for scheduled execution (⚠ important step)
- Click Run workflow or wait for automatic execution. Once completed, the corresponding rules will be generated in the directory specified in the configuration.
- Log in to
GitHub
, click theCode
button in the upper right corner of this repository, and select and create a newCodespace
. - Wait for
Codespaces
to start, and you can directly debug this project.
When the source code is updated, your repository's home page will display a prompt like the one shown below:
At this point, select Sync fork and then choose Update branch to sync the updates.
(If you have modified the source code, there may be merge conflicts. Please handle them carefully.)
⚠ This repository no longer provides rule subscriptions. We highly recommend forking this project to build your own rule set.
Below are rule repositories built using this project. You can find suitable rule subscriptions in them:
Click to view
- 👉 issues