Do not create session and request objects if we are going to end up creating new one for Tor requests. This just wastes time.

This commit is contained in:
Christopher K. Hoadley 2019-11-28 18:50:53 -06:00
parent 8ef999fffd
commit 578248bf8e

View file

@ -168,11 +168,14 @@ def sherlock(username, site_data, verbose=False, tor=False, unique_tor=False, pr
executor = ThreadPoolExecutor(max_workers=len(site_data))
# Create session based on request methodology
underlying_session = requests.session()
underlying_request = requests.Request()
if tor or unique_tor:
#Requests using Tor obfuscation
underlying_request = TorRequest()
underlying_session = underlying_request.session
else:
#Normal requests
underlying_session = requests.session()
underlying_request = requests.Request()
# Create multi-threaded session for all requests. Use our custom FuturesSession that exposes response time
session = ElapsedFuturesSession(