Skip to content

Commit

Permalink
Implementing empty requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
franckferman committed Nov 9, 2023
1 parent 9bb6796 commit 808ba39
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/MetaDetective/MetaDetective.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,11 +900,15 @@ def process_url(url: str, depth: int, base_domain: str, q, seen: Set[str],

rate_limiter.wait()

links = fetch_links_from_url(url)
links = fetch_links_from_url(url)

file_links = [urljoin(url, link) for link in links if is_valid_file_link(link)]

if download_dir and not scan:
if not file_links:
print("\nNo files found or no files with specified extensions.")
return

for file_link in file_links:
download_file(file_link, download_dir)
elif scan:
Expand Down Expand Up @@ -1216,6 +1220,10 @@ def main():
t.join()

if args.scan:
if not any(file_stats.values()):
print("\nNo files found or no files with specified extensions.")
sys.exit(0)

print("\nScan results:\n")
print("+---------------+-----------------------------------+")
print("| File Extension | Estimated Number of Unique Files |")
Expand Down

0 comments on commit 808ba39

Please sign in to comment.