-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b39dc27
commit 7fc7a54
Showing
40 changed files
with
2,455,986 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,53 @@ | ||
``` | ||
更新时间: 2024-11-13 16:12:58 (北京时间) | ||
插件拦截规则数量: 175281 | ||
DNS拦截规则数量: 45809 | ||
``` | ||
# AdBlock DNS Filters | ||
适用于AdGuard的去广告合并规则,每8个小时更新一次。 | ||
个人收藏了不少广告过滤规则,但是每次往新设备添加的时候很是头疼,于是写了这个项目,定时自动获取各规则源更新,生成合并规则库。 | ||
|
||
## 说明 | ||
1. 定时从上游各规则源获取更新,合并去重。 | ||
2. 使用国内、国外各 3 组 DNS 服务,分别对上游各规则源拦截的域名进行解析,去除已无法解析的域名。(上游各规则源中存在大量已无法解析的域名,无需加入拦截规则) | ||
3. 本项目仅对上游规则进行合并、去重、去除无效域名,不做任何修改。如发现误拦截情况,可临时添加放行规则(如 `@@||www.example.com^$important`),并向上游规则反馈。 | ||
4. 手机推荐使用 [halflife-list](https://subscribe.adblockplus.org/?location=https://raw.githubusercontent.com/sbwml/halflife-list/master/ad.txt&title=halflife-list) + [ADgk](https://subscribe.adblockplus.org/?location=https://raw.githubusercontent.com/banbendalao/ADgk/master/ADgk.txt&title=ADgk) (点击直接导入) | ||
|
||
## 订阅链接 | ||
1. AdGuard Home 等DNS拦截服务使用规则1 | ||
1. AdGuard Home 等 DNS 拦截服务使用规则1 | ||
2. AdGuard 等浏览器插件使用规则1 + 规则2 | ||
3. 规则1’、规则2’为相应的 Lite 版,仅针对国内域名拦截 | ||
|
||
| 规则 | 原始链接 | 加速链接 | | ||
|:-|:-|:-| | ||
| 规则1:DNS 拦截 | [原始链接](https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/adblockdns.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/adblockdns.txt) | | ||
| 规则2:插件拦截 | [原始链接](https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/adblockfilters.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/adblockfilters.txt) | | ||
| 规则1:DNS 拦截 | [原始链接](https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/adblockdns.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/adblockdns.txt) | | ||
| 规则1':DNS 拦截 Lite | [原始链接](https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/adblockdnslite.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/adblockdnslite.txt) | | ||
| 规则2:插件拦截 | [原始链接](https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/adblockfilters.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/adblockfilters.txt) | | ||
| 规则2':插件拦截 Lite | [原始链接](https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/adblockfilterslite.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/adblockfilterslite.txt) | | ||
|
||
## 上游规则源 | ||
1. 感谢各位广告过滤规则维护大佬们的辛苦付出。 | ||
2. 不再引用[anti-AD](https://anti-ad.net/adguard.txt)、[yhosts](https://raw.githubusercontent.com/VeleSila/yhosts/master/hosts.txt),具体原因见[Mosney/anti-anti-AD](https://github.com/Mosney/anti-anti-AD)。 | ||
3. 移除[Notracking blocklist](https://raw.githubusercontent.com/notracking/hosts-blocklists/master/adblock/adblock.txt),原项目[已停止维护](https://github.com/notracking/hosts-blocklists/issues/900)。 | ||
4. 移除[ADgk](https://raw.githubusercontent.com/banbendalao/ADgk/master/ADgk.txt),项目超过 1 年未更新。 | ||
5. 不再引用[NEO DEV HOST](https://github.com/neodevpro/neodevhost/blob/master/lite_adblocker),原因见[Issues 85](https://github.com/217heidai/adblockfilters/issues/85)。 | ||
|
||
| 规则 | 类型 | 原始链接 | 加速链接 | 更新日期 | | ||
|:-|:-|:-|:-|:-| | ||
| AdGuard Base filters | filter | [原始链接](https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_2_Base/filter.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/AdGuard_Base_filters.txt) | 2024/11/13 | | ||
| AdGuard Chinese filters | filter | [原始链接](https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_224_Chinese/filter.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/AdGuard_Chinese_filters.txt) | 2024/11/13 | | ||
| AdGuard Annoyances filter | filter | [原始链接](https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_14_Annoyances/filter.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/AdGuard_Annoyances_filter.txt) | 2024/11/13 | | ||
| EasyList China | filter | [原始链接](https://easylist-downloads.adblockplus.org/easylistchina.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/EasyList_China.txt) | 2024/11/13 | | ||
| EasyPrivacy | filter | [原始链接](https://easylist-downloads.adblockplus.org/easyprivacy.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/EasyPrivacy.txt) | 2024/11/13 | | ||
| Fanboy's Annoyance List | filter | [原始链接](https://easylist.to/easylist/fanboy-social.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/Fanboy's_Annoyance_List.txt) | 2024/11/13 | | ||
| CJX's Annoyance List | filter | [原始链接](https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/CJX's_Annoyance_List.txt) | 2024/09/27 | | ||
| NoAppDownload | filter | [原始链接](https://raw.githubusercontent.com/Noyllopa/NoAppDownload/master/NoAppDownload.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/NoAppDownload.txt) | 2024/10/19 | | ||
| Adblock Warning Removal List | filter | [原始链接](https://easylist-downloads.adblockplus.org/antiAdblock.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/Adblock_Warning_Removal_List.txt) | 2024/09/27 | | ||
| damengzhu | filter | [原始链接](https://raw.githubusercontent.com/damengzhu/banad/main/jiekouAD.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/damengzhu.txt) | 2024/11/13 | | ||
| xinggsf mv | filter | [原始链接](https://raw.githubusercontent.com/xinggsf/Adblock-Plus-Rule/master/mv.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/xinggsf_mv.txt) | 2024/11/08 | | ||
| xinggsf rule | filter | [原始链接](https://raw.githubusercontent.com/xinggsf/Adblock-Plus-Rule/master/rule.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/xinggsf_rule.txt) | 2024/11/02 | | ||
| SmartTV Blocklist | dns | [原始链接](https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/SmartTV_Blocklist.txt) | 2024/02/15 | | ||
| AWAvenue Ads Rule | dns | [原始链接](https://raw.githubusercontent.com/TG-Twilight/AWAvenue-Ads-Rule/main/AWAvenue-Ads-Rule.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/AWAvenue_Ads_Rule.txt) | 2024/11/08 | | ||
| Urlhaus Malicious URL Blocklist | dns | [原始链接](https://malware-filter.gitlab.io/malware-filter/urlhaus-filter-agh-online.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/Urlhaus_Malicious_URL_Blocklist.txt) | 2024/11/13 | | ||
| Nocoin list | host | [原始链接](https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/Nocoin_list.txt) | 2024/09/27 | | ||
| 1024 hosts | host | [原始链接](https://raw.githubusercontent.com/Goooler/1024_hosts/master/hosts) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/1024_hosts.txt) | 2024/02/15 | | ||
| ad-wars hosts | host | [原始链接](https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/Sereinfy/Adblock/main/rules/ad-wars_hosts.txt) | 2024/02/15 | | ||
| AdGuard Base filter | filter | [原始链接](https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_2_Base/filter.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/AdGuard_Base_filter.txt) | 2024/11/13 | | ||
| AdGuard Chinese filter | filter | [原始链接](https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_224_Chinese/filter.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/AdGuard_Chinese_filter.txt) | 2024/11/13 | | ||
| AdGuard Mobile Ads filter | filter | [原始链接](https://raw.githubusercontent.com/AdguardTeam/AdguardFilters/master/MobileFilter/sections/adservers.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/AdGuard_Mobile_Ads_filter.txt) | 2024/11/12 | | ||
| AdGuard DNS filter | filter | [原始链接](https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/AdGuard_DNS_filter.txt) | 2024/11/13 | | ||
| AdRules DNS List | filter | [原始链接](https://raw.githubusercontent.com/Cats-Team/AdRules/main/dns.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/AdRules_DNS_List.txt) | 2024/11/13 | | ||
| CJX's Annoyance List | filter | [原始链接](https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/CJX's_Annoyance_List.txt) | 2024/09/26 | | ||
| EasyList | filter | [原始链接](https://easylist-downloads.adblockplus.org/easylist.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/EasyList.txt) | 2024/11/13 | | ||
| EasyList China | filter | [原始链接](https://easylist-downloads.adblockplus.org/easylistchina.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/EasyList_China.txt) | 2024/11/13 | | ||
| EasyPrivacy | filter | [原始链接](https://easylist-downloads.adblockplus.org/easyprivacy.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/EasyPrivacy.txt) | 2024/11/13 | | ||
| xinggsf mv | filter | [原始链接](https://raw.githubusercontent.com/xinggsf/Adblock-Plus-Rule/master/mv.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/xinggsf_mv.txt) | 2024/11/08 | | ||
| xinggsf rule | filter | [原始链接](https://raw.githubusercontent.com/xinggsf/Adblock-Plus-Rule/master/rule.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/xinggsf_rule.txt) | 2024/11/02 | | ||
| jiekouAD | filter | [原始链接](https://raw.githubusercontent.com/damengzhu/banad/main/jiekouAD.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/jiekouAD.txt) | 2024/11/13 | | ||
| 1Hosts (Lite) | dns | [原始链接](https://raw.githubusercontent.com/badmojr/1Hosts/master/Lite/adblock.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/1Hosts_(Lite).txt) | 2024/11/12 | | ||
| AWAvenue Ads Rule | dns | [原始链接](https://raw.githubusercontent.com/TG-Twilight/AWAvenue-Ads-Rule/main/AWAvenue-Ads-Rule.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/AWAvenue_Ads_Rule.txt) | 2024/11/08 | | ||
| Hblock | dns | [原始链接](https://hblock.molinero.dev/hosts_adblock.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/Hblock.txt) | 2024/11/13 | | ||
| OISD Basic | dns | [原始链接](https://abp.oisd.nl/basic/) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/OISD_Basic.txt) | 2024/11/13 | | ||
| SmartTV Blocklist | dns | [原始链接](https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/SmartTV_Blocklist.txt) | 2023/10/11 | | ||
| 1024 hosts | host | [原始链接](https://raw.githubusercontent.com/Goooler/1024_hosts/master/hosts) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/1024_hosts.txt) | 2023/08/31 | | ||
| ad-wars hosts | host | [原始链接](https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/ad-wars_hosts.txt) | 2023/11/17 | | ||
| StevenBlack hosts | host | [原始链接](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts) | [加速链接](https://mirror.ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/StevenBlack_hosts.txt) | 2024/11/12 | | ||
|
||
## Star History | ||
[](https://star-history.com/#217heidai/adblockfilters&Date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import os | ||
|
||
from loguru import logger | ||
|
||
from readme import ReadMe | ||
from updater import Updater | ||
from filter import Filter | ||
|
||
class ADBlock(object): | ||
def __init__(self): | ||
self.pwd = os.getcwd() | ||
|
||
def refresh(self): | ||
readme = ReadMe(self.pwd + '/README.md') | ||
ruleList = readme.getRules() | ||
''' | ||
# for test | ||
testList = [] | ||
for rule in ruleList: | ||
if rule.type in ['filter']: | ||
testList.append(rule) | ||
# if rule.name in ["AdGuard Mobile Ads filter"]: # "AdRules DNS List", "CJX's Annoyance List", "EasyList China", "EasyList", "EasyPrivacy", "jiekouAD", "xinggsf mv", "xinggsf rule" | ||
# testList.append(rule) | ||
ruleList = testList | ||
''' | ||
# 更新上游规 | ||
updater = Updater(ruleList) | ||
update, ruleList = updater.update(self.pwd + '/rules') | ||
if not update: | ||
return | ||
|
||
# 生成新规则 | ||
filter = Filter(ruleList, self.pwd + '/rules') | ||
filter.generate() | ||
|
||
# 生成 readme.md | ||
readme.setRules(ruleList) | ||
readme.regenerate() | ||
|
||
|
||
if __name__ == '__main__': | ||
''' | ||
# for test | ||
logFile = os.getcwd() + "/adblock.log" | ||
if os.path.exists(logFile): | ||
os.remove(logFile) | ||
logger.add(logFile) | ||
''' | ||
adBlock = ADBlock() | ||
adBlock.refresh() |
Oops, something went wrong.