diff --git a/pyproject.toml b/pyproject.toml index 0cfc9276a..411845989 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,9 @@ torrequest = "^0.1.0" pandas = ">=1.0.0,<3.0.0" openpyxl = "^3.0.10" +[tool.poetry.extras] +tor = ["torrequest"] + [tool.poetry.group.dev.dependencies] jsonschema = "^4.0.0" diff --git a/sherlock_project/sherlock.py b/sherlock_project/sherlock.py index 2464e04ca..36859b4b8 100644 --- a/sherlock_project/sherlock.py +++ b/sherlock_project/sherlock.py @@ -211,6 +211,18 @@ def sherlock( query_notify.start(username) # Create session based on request methodology if tor or unique_tor: + try: + from torrequest import TorRequest # noqa: E402 + except ImportError: + print("Important!") + print("> --tor and --unique-tor are now DEPRECATED, and may be removed in a future release of Sherlock.") + print("> If you've installed Sherlock via pip, you can include the optional dependency via `pip install sherlock-project[tor]`.") + print("> Other packages should refer to their documentation, or install it separately with `pip install torrequest`.\n") + sys.exit(query_notify.finish()) + + print("Important!") + print("> --tor and --unique-tor are now DEPRECATED, and may be removed in a future release of Sherlock.")) + # Requests using Tor obfuscation try: underlying_request = TorRequest()