def tor_test():
# Get Tor IP from wtfismyip
try:
with urllib.request.urlopen('https://wtfismyip.com/text') as response:
html = response.read()
print_out(Style.BRIGHT + Fore.GREEN + "Your Tor IP is: " + html.decode('utf-8'))
except HTTPError as e:
# do something
print_out(Style.BRIGHT + Fore.RED + "Error code: " + str(e.code))
exit(1)
except URLError as e:
# do something
print_out(Style.BRIGHT + Fore.RED + "Reason: " + str(e.reason))
exit(1)
评论列表
文章目录