From 01d6d6f907661f6b70f7c6ed092b1ebbd6a4c844 Mon Sep 17 00:00:00 2001 From: Adrian Miller Date: Sat, 7 Jan 2023 02:28:07 +1100 Subject: [PATCH] Update generate-domains-blocklist.py more "proper" domain sorting.... --- config/generate-domains-blocklist.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/generate-domains-blocklist.py b/config/generate-domains-blocklist.py index 1857df6..27e96bc 100644 --- a/config/generate-domains-blocklist.py +++ b/config/generate-domains-blocklist.py @@ -7,6 +7,8 @@ import argparse import re import sys +domain_list = [] + try: import urllib2 as urllib @@ -257,7 +259,8 @@ def blocklists_from_config_file( print("# Ignored entries due to the allowlist: {}".format(allowed)) list_names = sorted(set(list_names)) for name in list_names: - print(name) + domain_list.append(name) + for y in sorted([x.strip().split('.')[::-1] for x in domain_list]): print('.'.join(y[::-1])) argp = argparse.ArgumentParser(