From 2accdcafea95cb435e9b83b4394f9a1e4a728eae Mon Sep 17 00:00:00 2001 From: BlucyBlue Date: Sun, 20 Jan 2019 19:26:17 +0100 Subject: [PATCH] If the user selected --check_proxies option along with --proxy_list option, proxies loaded from the .csv file are checked using the check_proxies function from the load_proxies module. Proxies which pass the test are stored in the proxy_list global var. --- sherlock.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sherlock.py b/sherlock.py index 6c915a0..726f908 100644 --- a/sherlock.py +++ b/sherlock.py @@ -427,6 +427,19 @@ def main(): proxy_list = load_proxies_from_csv(args.proxy_list) + # Checking if proxies should be checked for anonymity. + if args.check_prox != None and args.proxy_list != None: + try: + limit = int(args.check_prox) + if limit == 0: + proxy_list = check_proxy_list(proxy_list) + elif limit > 0: + proxy_list = check_proxy_list(proxy_list, limit) + else: + raise ValueError + except ValueError: + raise Exception("Prameter --check_proxies/-cp must be a positive intiger.") + if args.tor or args.unique_tor: print("Using TOR to make requests") print("Warning: some websites might refuse connecting over TOR, so note that using this option might increase connection errors.")