From c34eb843b6e5155ca7e11d89628c3266adacaceb Mon Sep 17 00:00:00 2001 From: Paulo Diovani Date: Wed, 4 Dec 2019 13:42:29 -0300 Subject: [PATCH] Set a timeout limit (10s) for requests --- sherlock.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sherlock.py b/sherlock.py index 9c8af67a..d329789c 100755 --- a/sherlock.py +++ b/sherlock.py @@ -30,9 +30,10 @@ __version__ = "0.9.12" amount = 0 -global proxy_list +global proxy_list, timeout_limit proxy_list = [] +timeout_limit = 10 class ElapsedFuturesSession(FuturesSession): """ @@ -246,11 +247,13 @@ def sherlock(username, site_data, verbose=False, tor=False, unique_tor=False, pr proxies = {"http": proxy, "https": proxy} future = request_method(url=url_probe, headers=headers, proxies=proxies, - allow_redirects=allow_redirects + allow_redirects=allow_redirects, + timeout=timeout_limit ) else: future = request_method(url=url_probe, headers=headers, - allow_redirects=allow_redirects + allow_redirects=allow_redirects, + timeout=timeout_limit ) # Store future in data for access later