Browse Source

update: assets script output

dev
Dnomd343 2 years ago
parent
commit
01cfb13630
  1. 4
      assets/china-ip.py
  2. 5
      assets/chinalist.py
  3. 5
      assets/gfwlist.py

4
assets/china-ip.py

@ -48,4 +48,6 @@ for ip in v4:
for ip in v6: for ip in v6:
ips.append(str(ip) + ('' if '/' in str(ip) else '/128')) 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')

5
assets/chinalist.py

@ -19,4 +19,7 @@ for script in source:
domains.update(filter(None, raw)) 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})+$' 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} 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')

5
assets/gfwlist.py

@ -24,4 +24,7 @@ for script in source:
domains.update(filter(None, raw)) 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})+$' 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} 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')

Loading…
Cancel
Save