Last active
October 24, 2017 22:53
-
-
Save GrenderG/c680b8f4a723ef81b2fdadc83b641848 to your computer and use it in GitHub Desktop.
Check if you are using Tor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
TOR_CHECK_URL = 'https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=1.1.1.1' | |
IPIFY_API_URL = 'https://api.ipify.org' | |
def check_tor(): | |
ip = requests.get(IPIFY_API_URL).text | |
tor_exit_node_list = requests.get(TOR_CHECK_URL).text | |
return ip in tor_exit_node_list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment