Update app.py
Browse files
app.py
CHANGED
|
@@ -248,6 +248,7 @@ def crawl_onion_directory(url, rel_path=""):
|
|
| 248 |
return
|
| 249 |
|
| 250 |
log(f"π Scanning directory index: /{rel_path}")
|
|
|
|
| 251 |
|
| 252 |
start_time = time.time()
|
| 253 |
try:
|
|
@@ -259,7 +260,7 @@ def crawl_onion_directory(url, rel_path=""):
|
|
| 259 |
|
| 260 |
html = r.text
|
| 261 |
elapsed = time.time() - start_time
|
| 262 |
-
log(f"
|
| 263 |
|
| 264 |
# Use lxml for faster parsing if available, else fallback to html.parser
|
| 265 |
try:
|
|
@@ -287,7 +288,7 @@ def crawl_onion_directory(url, rel_path=""):
|
|
| 287 |
# Yield file immediately so download can start
|
| 288 |
yield (full_url, new_rel_path)
|
| 289 |
|
| 290 |
-
log(f" Found {file_count} files and {len(subdirectory_links)} subdirectories in /{rel_path}")
|
| 291 |
|
| 292 |
# Now recurse into subdirectories
|
| 293 |
success = True
|
|
|
|
| 248 |
return
|
| 249 |
|
| 250 |
log(f"π Scanning directory index: /{rel_path}")
|
| 251 |
+
log(f" π Fetching directory listing...")
|
| 252 |
|
| 253 |
start_time = time.time()
|
| 254 |
try:
|
|
|
|
| 260 |
|
| 261 |
html = r.text
|
| 262 |
elapsed = time.time() - start_time
|
| 263 |
+
log(f" β
Fetched listing in {elapsed:.2f}s ({len(html)} bytes)")
|
| 264 |
|
| 265 |
# Use lxml for faster parsing if available, else fallback to html.parser
|
| 266 |
try:
|
|
|
|
| 288 |
# Yield file immediately so download can start
|
| 289 |
yield (full_url, new_rel_path)
|
| 290 |
|
| 291 |
+
log(f" π Found {file_count} files and {len(subdirectory_links)} subdirectories in /{rel_path}")
|
| 292 |
|
| 293 |
# Now recurse into subdirectories
|
| 294 |
success = True
|