From 855f154d9b828d2d494c3bcab059336688b9eb00 Mon Sep 17 00:00:00 2001 From: BlucyBlue Date: Sun, 20 Jan 2019 19:31:08 +0100 Subject: [PATCH] If the 'proxy_list' we select a random member and pass it as the proxy to the session. If the list is empty, the proxy parameter will be set to arg.proxy, which defaults to None if the user did not pass an individual proxy as well. --- sherlock.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sherlock.py b/sherlock.py index 726f908..3cd34e8 100644 --- a/sherlock.py +++ b/sherlock.py @@ -534,6 +534,15 @@ def main(): username + ".txt"), "w", encoding="utf-8") else: file = open(username + ".txt", "w", encoding="utf-8") + + # We try to ad a random member of the 'proxy_list' var as the proxy of the request. + # If we can't access the list or it is empty, we proceed with args.proxy as the proxy. + try: + random_proxy = random.choice(proxy_list) + proxy = f'{random_proxy.protocol}://{random_proxy.ip}:{random_proxy.port}' + except (NameError, IndexError): + proxy = args.proxy + results = {} results = sherlock(username, site_data, verbose=args.verbose, tor=args.tor, unique_tor=args.unique_tor, proxy=args.proxy)