diff --git a/README.md b/README.md index f8b1c0290..3d23d3aff 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,8 @@ $ python3 sherlock --help usage: sherlock [-h] [--version] [--verbose] [--folderoutput FOLDEROUTPUT] [--output OUTPUT] [--tor] [--unique-tor] [--csv] [--xlsx] [--site SITE_NAME] [--proxy PROXY_URL] [--json JSON_FILE] - [--timeout TIMEOUT] [--print-all] [--print-found] [--no-color] - [--browse] [--local] [--nsfw] + [--workers WORKERS] [--timeout TIMEOUT] [--print-all] + [--print-found] [--no-color] [--browse] [--local] [--nsfw] USERNAMES [USERNAMES ...] Sherlock: Find Usernames Across Social Networks (Version 0.14.3) @@ -77,6 +77,7 @@ optional arguments: Make requests over a proxy. e.g. socks5://127.0.0.1:1080 --json JSON_FILE, -j JSON_FILE Load data from a JSON file or an online, valid, JSON file. + --workers WORKERS Set the maximum number of workers (Default: 20) --timeout TIMEOUT Time (in seconds) to wait for response to requests (Default: 60) --print-all Output sites where the username was not found. --print-found Output sites where the username was found. diff --git a/sherlock/sherlock.py b/sherlock/sherlock.py index fb9f52453..e01772b65 100644 --- a/sherlock/sherlock.py +++ b/sherlock/sherlock.py @@ -163,6 +163,7 @@ def sherlock( unique_tor=False, proxy=None, timeout=60, + max_workers:int=20 ): """Run Sherlock Analysis. @@ -207,11 +208,8 @@ def sherlock( underlying_session = requests.session() underlying_request = requests.Request() - # Limit number of workers to 20. - # This is probably vastly overkill. - if len(site_data) >= 20: - max_workers = 20 - else: + # Reduce worker count if greater than size of target pool + if len(site_data) < max_workers: max_workers = len(site_data) # Create multi-threaded session for all requests. @@ -582,6 +580,13 @@ def main(): default=None, help="Load data from a JSON file or an online, valid, JSON file.", ) + parser.add_argument( + "--workers", + type=int, + default=20, + dest="workers", + help="Set the maximum number of workers for Sherlock (Default: 20)" + ) parser.add_argument( "--timeout", action="store", @@ -764,6 +769,7 @@ def main(): unique_tor=args.unique_tor, proxy=args.proxy, timeout=args.timeout, + max_workers=args.workers ) if args.output: