From 0c4195ab7394b9cfb4665eacd814c2d32fbf0243 Mon Sep 17 00:00:00 2001 From: 4shen0ne <4shen.01@gmail.com> Date: Mon, 14 Oct 2024 15:19:22 +0800 Subject: [PATCH] move --async to General --- README.md | 5 +++-- config.ini | 2 +- lib/core/options.py | 2 +- lib/parse/cmdline.py | 12 ++++++------ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1e016bea9..e1dc40796 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Table of Contents * [Pausing progress](#pausing-progress) * [Recursion](#recursion) * [Threads](#threads) + * [Asynchronous](#asynchronous) * [Prefixes / Suffixes](#prefixes--suffixes) * [Blacklist](#blacklist) * [Filters](#filters) @@ -176,6 +177,7 @@ Options: General Settings: -t THREADS, --threads=THREADS Number of threads + --async Enable asynchronous mode -r, --recursive Brute-force recursively --deep-recursive Perform recursive scan on every directory depth (e.g. api/users -> api/) @@ -264,7 +266,6 @@ Options: Advanced Settings: --crawl Crawl for new paths in responses - --async Enable asynchronous mode View Settings: --full-url Full URLs in the output (enabled automatically in @@ -297,6 +298,7 @@ By default, `config.ini` inside your dirsearch directory is used as the configur [general] threads = 25 +async = False recursive = False deep-recursive = False force-recursive = False @@ -348,7 +350,6 @@ max-retries = 1 [advanced] crawl = False -async = False [view] full-url = False diff --git a/config.ini b/config.ini index fdec2dc9a..7a005a2ae 100644 --- a/config.ini +++ b/config.ini @@ -4,6 +4,7 @@ [general] threads = 25 +async = False recursive = False deep-recursive = False force-recursive = False @@ -63,7 +64,6 @@ max-retries = 1 [advanced] crawl = False -async = False [view] full-url = False diff --git a/lib/core/options.py b/lib/core/options.py index 04a573baa..8bcdce5be 100755 --- a/lib/core/options.py +++ b/lib/core/options.py @@ -249,6 +249,7 @@ def parse_config(opt): # General opt.thread_count = opt.thread_count or config.safe_getint("general", "threads", 25) + opt.async_mode = opt.async_mode or config.safe_getboolean("general", "async") opt.include_status_codes = opt.include_status_codes or config.safe_get( "general", "include-status" ) @@ -353,7 +354,6 @@ def parse_config(opt): # Advanced opt.crawl = opt.crawl or config.safe_getboolean("advanced", "crawl") - opt.async_mode = opt.async_mode or config.safe_getboolean("advanced", "async") # View opt.full_url = opt.full_url or config.safe_getboolean("view", "full-url") diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index fb322307b..a63554a54 100755 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -168,6 +168,12 @@ def parse_arguments(): metavar="THREADS", help="Number of threads", ) + general.add_option( + "--async", + action="store_true", + dest="async_mode", + help="Enable asynchronous mode", + ) general.add_option( "-r", "--recursive", @@ -467,12 +473,6 @@ def parse_arguments(): dest="crawl", help="Crawl for new paths in responses" ) - advanced.add_option( - "--async", - action="store_true", - dest="async_mode", - help="Enable asynchronous mode", - ) # View Settings view = OptionGroup(parser, "View Settings")