Skip to content

Commit cfa4097

Browse files
committed
removed support for tor
1 parent ab869ef commit cfa4097

File tree

1 file changed

+4
-54
lines changed

1 file changed

+4
-54
lines changed

sherlock/sherlock.py

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
)
3131

3232
from requests_futures.sessions import FuturesSession # noqa: E402
33-
from torrequest import TorRequest # noqa: E402
3433
from sherlock.result import QueryStatus # noqa: E402
3534
from sherlock.result import QueryResult # noqa: E402
3635
from sherlock.notify import QueryNotify # noqa: E402
@@ -166,8 +165,6 @@ def sherlock(
166165
username,
167166
site_data,
168167
query_notify: QueryNotify,
169-
tor: bool = False,
170-
unique_tor: bool = False,
171168
proxy=None,
172169
timeout=60,
173170
):
@@ -182,8 +179,6 @@ def sherlock(
182179
query_notify -- Object with base type of QueryNotify().
183180
This will be used to notify the caller about
184181
query results.
185-
tor -- Boolean indicating whether to use a tor circuit for the requests.
186-
unique_tor -- Boolean indicating whether to use a new tor circuit for each request.
187182
proxy -- String indicating the proxy URL
188183
timeout -- Time in seconds to wait before timing out request.
189184
Default is 60 seconds.
@@ -204,20 +199,10 @@ def sherlock(
204199

205200
# Notify caller that we are starting the query.
206201
query_notify.start(username)
207-
# Create session based on request methodology
208-
if tor or unique_tor:
209-
# Requests using Tor obfuscation
210-
try:
211-
underlying_request = TorRequest()
212-
except OSError:
213-
print("Tor not found in system path. Unable to continue.\n")
214-
sys.exit(query_notify.finish())
215202

216-
underlying_session = underlying_request.session
217-
else:
218-
# Normal requests
219-
underlying_session = requests.session()
220-
underlying_request = requests.Request()
203+
# Normal requests
204+
underlying_session = requests.session()
205+
underlying_request = requests.Request()
221206

222207
# Limit number of workers to 20.
223208
# This is probably vastly overkill.
@@ -341,15 +326,10 @@ def sherlock(
341326
# Store future in data for access later
342327
net_info["request_future"] = future
343328

344-
# Reset identify for tor (if needed)
345-
if unique_tor:
346-
underlying_request.reset_identity()
347-
348329
# Add this site's results into final dictionary with all the other results.
349330
results_total[social_network] = results_site
350331

351332
# Open the file containing account links
352-
# Core logic: If tor requests, make them here. If multi-threaded requests, wait for responses
353333
for social_network, net_info in site_data.items():
354334
# Retrieve results again
355335
results_site = results_total.get(social_network)
@@ -547,23 +527,7 @@ def main():
547527
"-o",
548528
dest="output",
549529
help="If using single username, the output of the result will be saved to this file.",
550-
)
551-
parser.add_argument(
552-
"--tor",
553-
"-t",
554-
action="store_true",
555-
dest="tor",
556-
default=False,
557-
help="Make requests over Tor; increases runtime; requires Tor to be installed and in system path.",
558-
)
559-
parser.add_argument(
560-
"--unique-tor",
561-
"-u",
562-
action="store_true",
563-
dest="unique_tor",
564-
default=False,
565-
help="Make requests over Tor with new Tor circuit after each request; increases runtime; requires Tor to be installed and in system path.",
566-
)
530+
),
567531
parser.add_argument(
568532
"--csv",
569533
action="store_true",
@@ -687,22 +651,10 @@ def main():
687651
except Exception as error:
688652
print(f"A problem occurred while checking for an update: {error}")
689653

690-
# Argument check
691-
# TODO regex check on args.proxy
692-
if args.tor and (args.proxy is not None):
693-
raise Exception("Tor and Proxy cannot be set at the same time.")
694-
695654
# Make prompts
696655
if args.proxy is not None:
697656
print("Using the proxy: " + args.proxy)
698657

699-
if args.tor or args.unique_tor:
700-
print("Using Tor to make requests")
701-
702-
print(
703-
"Warning: some websites might refuse connecting over Tor, so note that using this option might increase connection errors."
704-
)
705-
706658
if args.no_color:
707659
# Disable color output.
708660
init(strip=True, convert=False)
@@ -781,8 +733,6 @@ def main():
781733
username,
782734
site_data,
783735
query_notify,
784-
tor=args.tor,
785-
unique_tor=args.unique_tor,
786736
proxy=args.proxy,
787737
timeout=args.timeout,
788738
)

0 commit comments

Comments
 (0)