Skip to content

Bulk asynchronous downloader for multiple file hosts

Update progress_manager.py

Jacobca9778f728e4
diff --git a/cyberdrop_dl/managers/progress_manager.py b/cyberdrop_dl/managers/progress_manager.py
index 5203f5382..855fe10b7 100644
--- a/cyberdrop_dl/managers/progress_manager.py
+++ b/cyberdrop_dl/managers/progress_manager.py
@@ -1,10 +1,10 @@
from __future__ import annotations
+
+import time
from dataclasses import field
from typing import TYPE_CHECKING
from rich.layout import Layout
-import time
-from datetime import timedelta
from cyberdrop_dl.ui.progress.downloads_progress import DownloadsProgress
from cyberdrop_dl.ui.progress.file_progress import FileProgress
@@ -12,7 +12,7 @@ from cyberdrop_dl.ui.progress.hash_progress import HashProgress
from cyberdrop_dl.ui.progress.scraping_progress import ScrapingProgress
from cyberdrop_dl.ui.progress.sort_progress import SortProgress
from cyberdrop_dl.ui.progress.statistic_progress import DownloadStatsProgress, ScrapeStatsProgress
-from cyberdrop_dl.utils.utilities import log_with_color, get_log_output_text, log, log_spacer, parse_bytes, parse_rich_text_by_style, STYLE_TO_DIFF_FORMAT_MAP
+from cyberdrop_dl.utils.utilities import log_with_color, log, log_spacer, parse_bytes
if TYPE_CHECKING:
from cyberdrop_dl.managers.manager import Manager
@@ -70,36 +70,37 @@ class ProgressManager:
"""Prints the stats of the program"""
end_time = time.perf_counter()
- total_time = timedelta(seconds = int(end_time - start_time))
- downloaded_data , unit = parse_bytes (self.file_progress.downloaded_data)
+ total_time = timedelta(seconds=int(end_time - start_time))
+ downloaded_data, unit = parse_bytes(self.file_progress.downloaded_data)
await log("Printing Stats...\n", 20)
await log_with_color("Run Stats:", "cyan", 20)
await log_with_color(f" Total Runtime: {total_time}", "yellow", 20)
await log_with_color(f" Total Downloaded Data: {downloaded_data:.2f} {unit}", "yellow", 20)
- await log_spacer(20,'')
+ await log_spacer(20, '')
await log_with_color("Download Stats:", "cyan", 20)
await log_with_color(f" Downloaded {self.download_progress.completed_files} files", "green", 20)
await log_with_color(f" Previously Downloaded {self.download_progress.previously_completed_files} files",
- "yellow", 20)
+ "yellow", 20)
await log_with_color(f" Skipped By Config {self.download_progress.skipped_files} files", "yellow", 20)
await log_with_color(f" Failed {self.download_stats_progress.failed_files} files", "red", 20)
- await log_spacer(20,'')
+ await log_spacer(20, '')
await log_with_color("Unsupported URLs Stats:", "cyan", 20)
await log_with_color(f" Sent to Jdownloader: {self.scrape_stats_progress.sent_to_jdownloader}", "yellow", 20)
await log_with_color(f" Skipped: {self.scrape_stats_progress.unsupported_urls_skipped}", "yellow", 20)
- await log_spacer(20,'')
+ await log_spacer(20, '')
await log_with_color("Dupe Stats:", "cyan", 20)
await log_with_color(f" Previously Hashed {self.hash_progress.prev_hashed_files} files", "yellow", 20)
await log_with_color(f" Newly Hashed {self.hash_progress.hashed_files} files", "yellow", 20)
await log_with_color(f" Removed From Current Downloads {self.hash_progress.removed_files} files", "yellow", 20)
- await log_with_color(f" Removed From Previous Downloads {self.hash_progress.removed_prev_files} files", "yellow",
- 20)
+ await log_with_color(f" Removed From Previous Downloads {self.hash_progress.removed_prev_files} files",
+ "yellow",
+ 20)
- await log_spacer(20,'')
+ await log_spacer(20, '')
await log_with_color("Sort Stats:", "cyan", 20)
await log_with_color(f" Organized: {self.sort_progress.audio_count} Audios", "green", 20)
await log_with_color(f" Organized: {self.sort_progress.image_count} Images", "green", 20)
@@ -107,7 +108,7 @@ class ProgressManager:
await log_with_color(f" Organized: {self.sort_progress.other_count} Other Files", "green", 20)
scrape_failures = await self.scrape_stats_progress.return_totals()
- await log_spacer(20,'')
+ await log_spacer(20, '')
await log_with_color("Scrape Failures:", "cyan", 20)
if not scrape_failures:
await log_with_color(f" None", "green", 20)
@@ -115,7 +116,7 @@ class ProgressManager:
await log_with_color(f" ({key}): {value}", "red", 20)
download_failures = await self.download_stats_progress.return_totals()
- await log_spacer(20,'')
+ await log_spacer(20, '')
await log_with_color("Download Failures:", "cyan", 20)
if not download_failures:
await log_with_color(f" None", "green", 20)