Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/mrgnw/scripts.
Something went wrong. Try again.
1234567891011121314151617181920212223import requestsimport idna
# Retrieve the gTLD list from the URLurl = 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt'response = requests.get(url)response.raise_for_status()data = response.text
# Process the gTLD listgtld_list = []for line in data.splitlines(): if not line.startswith('#'): decoded_line = idna.decode(line) gtld_list.append(decoded_line)
# Save the decoded list to a filewith open('gtlds.txt', 'w', encoding='utf-8') as file: for gtld in gtld_list: file.write(gtld + '\n')
print("Decoded gTLD list saved to gtlds.txt")