Add NoTracking's list to the example blacklist configuration

Implement dnsmasq-style filters by the way
This commit is contained in:
Frank Denis 2018-03-26 20:43:42 +02:00
parent 6bca9eb795
commit 9224e79c59
2 changed files with 5 additions and 1 deletions

View File

@ -87,6 +87,9 @@ https://ssl.bblck.me/blacklists/domain-list.txt
# Dan Pollock's hosts list
http://someonewhocares.org/hosts/hosts
# NoTracking's list - blocking ads, trackers and other online garbage
https://raw.githubusercontent.com/notracking/hosts-blocklists/master/domains.txt
# CoinBlockerLists: blocks websites serving cryptocurrency miners - https://zerodot1.github.io/CoinBlockerLists/ - Contains false positives
# https://raw.githubusercontent.com/ZeroDot1/CoinBlockerLists/master/list_browser.txt

View File

@ -16,10 +16,11 @@ def parse_list(content, trusted=False):
rx_h = re.compile(r'^[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}\s+([a-z0-9.-]+[.][a-z]{2,})$')
rx_mdl = re.compile(r'^"[^"]+","([a-z0-9.-]+[.][a-z]{2,})",')
rx_b = re.compile(r'^([a-z0-9.-]+[.][a-z]{2,}),.+,[0-9: /-]+,')
rx_dq = re.compile(r'^address=/([a-z0-9.-]+[.][a-z]{2,})/.')
rx_trusted = re.compile(r'^([*a-z0-9.-]+)$')
names = set()
rx_set = [rx_u, rx_l, rx_h, rx_mdl, rx_b]
rx_set = [rx_u, rx_l, rx_h, rx_mdl, rx_b, rx_dq]
if trusted:
rx_set = [rx_trusted]
for line in content.splitlines():