Skip to content

Commit

Permalink
Issue #83: Use Asyncio (asyncio for click)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekmo committed Oct 21, 2020
1 parent 2346c53 commit c639596
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion common-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ humanize
colorama
requests-mock
google
proxy-db
proxy-db
asyncclick
2 changes: 1 addition & 1 deletion dirhunt/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ def wrapped(*args, **kwargs):
except Exception as e:
traceback.print_exc()
raise e
return wrapped
return wrapped
7 changes: 4 additions & 3 deletions dirhunt/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function

import re
import click as click
import asyncclick as click
import os

import sys
Expand Down Expand Up @@ -125,11 +125,12 @@ def flags_range(flags):
help='Delay between requests to avoid bans by the server')
@click.option('--not-allow-redirects', is_flag=True, help='Redirectors will not be followed')
@click.option('--limit', type=int, default=1000, help='Max number of pages processed to search for directories.')
@click.option('--to-file', type=Path(writable=True), default=None, help='Create a report file in JSON.')
# @click.option('--to-file', type=Path(writable=True), default=None, help='Create a report file in JSON.')
@click.option('--to-file', type=str, default=None, help='Create a report file in JSON.')
@click.option('--user-agent', type=str, default=None, help='User agent to use. By default a random browser.')
@click.option('--version', is_flag=True, callback=print_version,
expose_value=False, is_eager=True)
def hunt(urls, threads, exclude_flags, include_flags, interesting_extensions, interesting_files, stdout_flags,
async def hunt(urls, threads, exclude_flags, include_flags, interesting_extensions, interesting_files, stdout_flags,
progress_enabled, timeout, max_depth, not_follow_subdomains, exclude_sources, proxies, delay,
not_allow_redirects, limit, to_file, user_agent):
"""Find web directories without bruteforce
Expand Down
2 changes: 1 addition & 1 deletion scripts/dirhunt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ from dirhunt.exceptions import catch
from dirhunt.management import hunt

if __name__ == '__main__':
catch(hunt)()
hunt(_anyio_backend="asyncio")

0 comments on commit c639596

Please sign in to comment.