diff --git a/assets/china-ip.py b/assets/china-ip.py index b25eeac..578af7d 100755 --- a/assets/china-ip.py +++ b/assets/china-ip.py @@ -48,4 +48,6 @@ for ip in v4: for ip in v6: ips.append(str(ip) + ('' if '/' in str(ip) else '/128')) -print('\n'.join(ips)) +with open('china-ip.txt', 'w') as fileObj: + fileObj.write('\n'.join(ips) + '\n') +os.system('xz -kf9 china-ip.txt') diff --git a/assets/chinalist.py b/assets/chinalist.py index c27588a..0161ef5 100755 --- a/assets/chinalist.py +++ b/assets/chinalist.py @@ -19,4 +19,7 @@ for script in source: domains.update(filter(None, raw)) regex = r'^(?=^.{3,255}$)[a-zA-Z0-9][a-zA-Z0-9\-]{0,62}(.[a-zA-Z0-9][a-zA-Z0-9\-]{0,62})+$' domains = {x for x in domains if re.search(regex, str(x)) is not None} -print('\n'.join(sorted(domains))) + +with open('chinalist.txt', 'w') as fileObj: + fileObj.write('\n'.join(sorted(domains)) + '\n') +os.system('xz -kf9 chinalist.txt') diff --git a/assets/gfwlist.py b/assets/gfwlist.py index a089c39..b76d1ad 100755 --- a/assets/gfwlist.py +++ b/assets/gfwlist.py @@ -24,4 +24,7 @@ for script in source: domains.update(filter(None, raw)) regex = r'^(?=^.{3,255}$)[a-zA-Z0-9][a-zA-Z0-9\-]{0,62}(.[a-zA-Z0-9][a-zA-Z0-9\-]{0,62})+$' domains = {x for x in domains if re.search(regex, str(x)) is not None} -print('\n'.join(sorted(domains))) + +with open('gfwlist.txt', 'w') as fileObj: + fileObj.write('\n'.join(sorted(domains)) + '\n') +os.system('xz -kf9 gfwlist.txt')