30
30
)
31
31
32
32
from requests_futures .sessions import FuturesSession # noqa: E402
33
- from torrequest import TorRequest # noqa: E402
34
33
from sherlock .result import QueryStatus # noqa: E402
35
34
from sherlock .result import QueryResult # noqa: E402
36
35
from sherlock .notify import QueryNotify # noqa: E402
@@ -166,8 +165,6 @@ def sherlock(
166
165
username ,
167
166
site_data ,
168
167
query_notify : QueryNotify ,
169
- tor : bool = False ,
170
- unique_tor : bool = False ,
171
168
proxy = None ,
172
169
timeout = 60 ,
173
170
):
@@ -182,8 +179,6 @@ def sherlock(
182
179
query_notify -- Object with base type of QueryNotify().
183
180
This will be used to notify the caller about
184
181
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.
187
182
proxy -- String indicating the proxy URL
188
183
timeout -- Time in seconds to wait before timing out request.
189
184
Default is 60 seconds.
@@ -204,20 +199,10 @@ def sherlock(
204
199
205
200
# Notify caller that we are starting the query.
206
201
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 ())
215
202
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 ()
221
206
222
207
# Limit number of workers to 20.
223
208
# This is probably vastly overkill.
@@ -341,15 +326,10 @@ def sherlock(
341
326
# Store future in data for access later
342
327
net_info ["request_future" ] = future
343
328
344
- # Reset identify for tor (if needed)
345
- if unique_tor :
346
- underlying_request .reset_identity ()
347
-
348
329
# Add this site's results into final dictionary with all the other results.
349
330
results_total [social_network ] = results_site
350
331
351
332
# Open the file containing account links
352
- # Core logic: If tor requests, make them here. If multi-threaded requests, wait for responses
353
333
for social_network , net_info in site_data .items ():
354
334
# Retrieve results again
355
335
results_site = results_total .get (social_network )
@@ -547,23 +527,7 @@ def main():
547
527
"-o" ,
548
528
dest = "output" ,
549
529
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
+ ),
567
531
parser .add_argument (
568
532
"--csv" ,
569
533
action = "store_true" ,
@@ -687,22 +651,10 @@ def main():
687
651
except Exception as error :
688
652
print (f"A problem occurred while checking for an update: { error } " )
689
653
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
-
695
654
# Make prompts
696
655
if args .proxy is not None :
697
656
print ("Using the proxy: " + args .proxy )
698
657
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
-
706
658
if args .no_color :
707
659
# Disable color output.
708
660
init (strip = True , convert = False )
@@ -781,8 +733,6 @@ def main():
781
733
username ,
782
734
site_data ,
783
735
query_notify ,
784
- tor = args .tor ,
785
- unique_tor = args .unique_tor ,
786
736
proxy = args .proxy ,
787
737
timeout = args .timeout ,
788
738
)
0 commit comments