Skip to content

Commit 808ba39

Browse files
committed
Implementing empty requests.
1 parent 9bb6796 commit 808ba39

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/MetaDetective/MetaDetective.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,11 +900,15 @@ def process_url(url: str, depth: int, base_domain: str, q, seen: Set[str],
900900

901901
rate_limiter.wait()
902902

903-
links = fetch_links_from_url(url)
903+
links = fetch_links_from_url(url)
904904

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

907907
if download_dir and not scan:
908+
if not file_links:
909+
print("\nNo files found or no files with specified extensions.")
910+
return
911+
908912
for file_link in file_links:
909913
download_file(file_link, download_dir)
910914
elif scan:
@@ -1216,6 +1220,10 @@ def main():
12161220
t.join()
12171221

12181222
if args.scan:
1223+
if not any(file_stats.values()):
1224+
print("\nNo files found or no files with specified extensions.")
1225+
sys.exit(0)
1226+
12191227
print("\nScan results:\n")
12201228
print("+---------------+-----------------------------------+")
12211229
print("| File Extension | Estimated Number of Unique Files |")

0 commit comments

Comments
 (0)