privacy-for-safari
privacy-for-safari copied to clipboard
Update tlds.json from the latest PSL
Task/Issue URL: Tech Design URL: CC:
Description:
This PR is to update the copy of the Public Suffix List to the latest version which is sourced from https://publicsuffix.org/list/public_suffix_list.dat
Steps to test this PR:
Reproduction
import requests
import json
url = "https://publicsuffix.org/list/public_suffix_list.dat"
response = requests.get(url)
response.raise_for_status()
data = response.text
lines = data.splitlines()
entries = [line.strip() for line in lines if line.strip() and not line.strip().startswith('//')]
with open('public_suffix_list.json', 'w', encoding='utf-8') as f:
json.dump(entries, f, indent=4, ensure_ascii=False)