mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
24 lines
527 B
Python
24 lines
527 B
Python
![]() |
#!/usr/bin/python
|
||
|
|
||
|
# Data is from https://publicsuffix.org/list/public_suffix_list.dat
|
||
|
|
||
|
tldlist = []
|
||
|
|
||
|
with open('public_suffix_list.dat', 'rb') as f:
|
||
|
content = f.read()
|
||
|
content = content.decode('utf-8')
|
||
|
for line in content.splitlines():
|
||
|
if line.startswith('//') or not line:
|
||
|
continue
|
||
|
tldlist.append(line)
|
||
|
|
||
|
tldcount = len(tldlist)
|
||
|
|
||
|
print('''static const char* TLDTbl[%d] = {''' % tldcount)
|
||
|
|
||
|
for tld in tldlist:
|
||
|
print(' "%s\\0",' % tld)
|
||
|
|
||
|
print('''};
|
||
|
static const qint16 TLDTblSize = %d;''' % tldcount)
|