Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make torrequest optional #2215

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
10 changes: 9 additions & 1 deletion sherlock/sherlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
)

from requests_futures.sessions import FuturesSession # noqa: E402
from torrequest import TorRequest # noqa: E402
from sherlock.result import QueryStatus # noqa: E402
from sherlock.result import QueryResult # noqa: E402
from sherlock.notify import QueryNotify # noqa: E402
Expand Down Expand Up @@ -206,6 +205,15 @@ 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("> Dependencies for --tor and --unique-tor are now optional, and WILL BE DEPRECATED in a future release of Sherlock.")
print("> If you've installed Sherlock via pipx, you can install the dependency with `pip install sherlock-project[tor]`.")
print("> Other packages should refer to their packager maintainer's documentation, or install separately with `pipx install torrequest`.\n")
sys.exit(query_notify.finish())

# Requests using Tor obfuscation
try:
underlying_request = TorRequest()
Expand Down
Loading