diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 4538dd31..d1ca708f 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -6,6 +6,7 @@ on: - master paths: - 'sources/**.txt' + - 'filters/**.txt' workflow_dispatch: jobs: diff --git a/filters/TLDs.txt b/filters/TLDs.txt new file mode 100644 index 00000000..9f2469d1 --- /dev/null +++ b/filters/TLDs.txt @@ -0,0 +1,2 @@ +gop +republican \ No newline at end of file diff --git a/filters/adblock.txt b/filters/adblock.txt deleted file mode 100644 index 192033bd..00000000 --- a/filters/adblock.txt +++ /dev/null @@ -1,2 +0,0 @@ -||gop^ -||republican^ \ No newline at end of file diff --git a/filters/dnsmasq.txt b/filters/dnsmasq.txt deleted file mode 100644 index 2ead77ef..00000000 --- a/filters/dnsmasq.txt +++ /dev/null @@ -1,2 +0,0 @@ -address=/.gop/ -address=/.republican/ \ No newline at end of file diff --git a/filters/ublacklist.txt b/filters/ublacklist.txt deleted file mode 100644 index c6265e56..00000000 --- a/filters/ublacklist.txt +++ /dev/null @@ -1,2 +0,0 @@ -*://*.gop/* -*://*.republican/* \ No newline at end of file diff --git a/scripts/domains_to_adblock.py b/scripts/domains_to_adblock.py index c4447b9c..cb2ca1b7 100644 --- a/scripts/domains_to_adblock.py +++ b/scripts/domains_to_adblock.py @@ -2,9 +2,16 @@ # Usage: # python domains_to_adblock.py > adblock.txt -text_file = open("domains.txt", "r") -lines = text_file.readlines() -text_file.close() +with open("domains.txt", "r") as domains: + linesdomains = domains.readlines() + +# Additional filters +## TLDs +with open("filters/TLDs.txt", "r") as tlds: + linestlds = tlds.readlines() + +# Complete list generation +lines = linesdomains + linestlds for line in lines: print('||' + line.strip() + '^') diff --git a/scripts/domains_to_dnsmasq.py b/scripts/domains_to_dnsmasq.py index 1a63aabd..0e939090 100644 --- a/scripts/domains_to_dnsmasq.py +++ b/scripts/domains_to_dnsmasq.py @@ -1,9 +1,17 @@ # This script converts domains.txt into dnsmasq's blocking syntax. +# Usage: # python domains_to_dnsmasq.py > dnsmasq.txt -text_file = open("domains.txt", "r") -lines = text_file.readlines() -text_file.close() +with open("domains.txt", "r") as domains: + linesdomains = domains.readlines() + +# Additional filters +## TLDs +with open("filters/TLDs.txt", "r") as tlds: + linestlds = tlds.readlines() + +# Complete list generation +lines = linesdomains + linestlds for line in lines: print('address=/' + line.strip() + '/') diff --git a/scripts/domains_to_ublacklist.py b/scripts/domains_to_ublacklist.py index d383f02b..70aebfe9 100644 --- a/scripts/domains_to_ublacklist.py +++ b/scripts/domains_to_ublacklist.py @@ -2,9 +2,16 @@ # Usage: # python domains_to_ublacklist.py > ublacklist.txt -text_file = open("domains.txt", "r") -lines = text_file.readlines() -text_file.close() +with open("domains.txt", "r") as domains: + linesdomains = domains.readlines() + +# Additional filters +## TLDs +with open("filters/TLDs.txt", "r") as tlds: + linestlds = tlds.readlines() + +# Complete list generation +lines = linesdomains + linestlds for line in lines: print('*://*.' + line.strip() + '/*') diff --git a/scripts/update.sh b/scripts/update.sh index 8ab430ec..df8c5dad 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -31,15 +31,14 @@ python scripts/domains_to_hosts.py > hosts.txt cp hosts.txt etc_hosts.txt # Previous filename for PiHole installations still subscribed to the old url. python scripts/domains_to_hosts_ipv6.py > hosts.txt.ipv6 python scripts/domains_to_dnsmasq.py > dnsmasq.txt -cat ./filters/dnsmasq.txt >> dnsmasq.txt ## For browser extensions. python scripts/domains_to_netsane.py > netsane.txt python scripts/domains_to_adblock.py > adblock_temp.txt cp ./headers/adblock.txt adblock.txt -cat adblock_temp.txt ./filters/adblock.txt >> adblock.txt +cat adblock_temp.txt >> adblock.txt rm adblock_temp.txt python scripts/domains_to_ublacklist.py > ublacklist_temp.txt cp ./headers/adblock.txt ublacklist.txt # Currently using the same adblock header until uBlacklist implements its own header. https://github.com/iorate/ublacklist/issues/351 -cat ublacklist_temp.txt ./filters/ublacklist.txt >> ublacklist.txt +cat ublacklist_temp.txt >> ublacklist.txt rm ublacklist_temp.txt \ No newline at end of file diff --git a/sources/Police and army/README.md b/sources/Police and army/README.md new file mode 100644 index 00000000..ace8776a --- /dev/null +++ b/sources/Police and army/README.md @@ -0,0 +1 @@ +Anything related to Blue Live Matters, the Thin Blue Line, etc. \ No newline at end of file