def download_csv():
global SERVERS_LIST_FILE
print Colors.OKBLUE+"Downloading Latest 'dnscrypt-resolvers.csv'.."+Colors.ENDC
try:
csv_file = urllib.URLopener()
csv_file.retrieve("https://raw.githubusercontent.com/jedisct1/dnscrypt-proxy/master/dnscrypt-resolvers.csv", "/opt/dnscrypt-resolvers.csv")
except:
print Colors.WARNING+"Unable to download 'dnscrypt-resolvers.csv'. Using default /usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv"+Colors.ENDC
if os.path.exists("/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv"):
SERVERS_LIST_FILE="/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv"
else:
print Colors.FAIL+"Default csv file not found. Exiting.."+Colors.ENDC
exit(2)
评论列表
文章目录