Update generate-domains-blocklist.py

more "proper" domain sorting....
This commit is contained in:
Adrian Miller 2023-01-07 02:28:07 +11:00 committed by GitHub
parent 28f89b1a73
commit 01d6d6f907
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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(