Skip to content

Commit

Permalink
Potential fix #988
Browse files Browse the repository at this point in the history
  • Loading branch information
stasinopoulos committed Dec 19, 2024
1 parent b2ee14a commit bade4b3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
44 changes: 23 additions & 21 deletions src/utils/crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,27 +102,29 @@ def normalize_results(output_href):
Store crawling results to a temporary file.
"""
def store_crawling(output_href):
while True:
message = "Do you want to store crawling results to a temporary file "
message += "(for eventual further processing with other tools)? [y/N] > "
message = common.read_input(message, default="N", check_batch=True)
if message in settings.CHOICE_YES:
filename = tempfile.mkstemp(suffix=settings.OUTPUT_FILE_EXT)[1]
info_msg = "Writing crawling results to a temporary file '" + str(filename) + "'."
settings.print_data_to_stdout(settings.print_info_msg(info_msg))
with open(filename, "a") as crawling_results:
for url in output_href:
crawling_results.write(url.encode(settings.DEFAULT_CODEC).decode() + "\n")
return
elif message in settings.CHOICE_NO:
return
elif message in settings.CHOICE_QUIT:
raise SystemExit()
else:
common.invalid_option(message)
pass


try:
while True:
message = "Do you want to store crawling results to a temporary file "
message += "(for eventual further processing with other tools)? [y/N] > "
message = common.read_input(message, default="N", check_batch=True)
if message in settings.CHOICE_YES:
filename = tempfile.mkstemp(suffix=settings.OUTPUT_FILE_EXT)[1]
info_msg = "Writing crawling results to a temporary file '" + str(filename) + "'."
settings.print_data_to_stdout(settings.print_info_msg(info_msg))
with open(filename, "a") as crawling_results:
for url in output_href:
crawling_results.write(url.encode(settings.DEFAULT_CODEC).decode() + "\n")
return
elif message in settings.CHOICE_NO:
return
elif message in settings.CHOICE_QUIT:
raise SystemExit()
else:
common.invalid_option(message)
pass
except:
pass

"""
Check for URLs in sitemap.xml.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def sys_argv_errors():
DESCRIPTION = "The command injection exploiter"
AUTHOR = "Anastasios Stasinopoulos"
VERSION_NUM = "4.0"
REVISION = "120"
REVISION = "121"
STABLE_RELEASE = False
VERSION = "v"
if STABLE_RELEASE:
Expand Down

0 comments on commit bade4b3

Please sign in to comment.