Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
refactor: make title a parameter
NTFSvolumeb1f3b821f632
diff --git a/cyberdrop_dl/ui/progress/deque_progress.py b/cyberdrop_dl/ui/progress/deque_progress.pyindex a17c90723..8fec9ae5b 100644--- a/cyberdrop_dl/ui/progress/deque_progress.py+++ b/cyberdrop_dl/ui/progress/deque_progress.py@@ -15,14 +15,14 @@ if TYPE_CHECKING:class DequeProgress(ABC):progress: Progress- title: strtype_str: str = "Files"color = "plum3"progress_str = "[{color}]{description}"overflow_str = "[{color}]... And {number} Other {type_str}"queue_str = "[{color}]... And {number} {type_str} In {title} Queue"- def __init__(self, visible_tasks_limit: int) -> None:+ def __init__(self, title: str, visible_tasks_limit: int) -> None:+ self.title = titleself.overflow = Progress("[progress.description]{task.description}")self.queue = Progress("[progress.description]{task.description}")self.progress_group = Group(self.progress, self.overflow, self.queue)diff --git a/cyberdrop_dl/ui/progress/file_progress.py b/cyberdrop_dl/ui/progress/file_progress.pyindex f5e9bd741..a5b4606cc 100644--- a/cyberdrop_dl/ui/progress/file_progress.py+++ b/cyberdrop_dl/ui/progress/file_progress.py@@ -28,8 +28,6 @@ def adjust_title(s: str, length: int = 40, placeholder: str = "...") -> str:class FileProgress(DequeProgress):"""Class that manages the download progress of individual files."""- title = "Downloads"-def __init__(self, visible_tasks_limit: int, manager: Manager) -> None:self.manager = managerself.progress = Progress(@@ -45,7 +43,7 @@ class FileProgress(DequeProgress):TimeRemainingColumn(),)self.downloaded_data = ByteSize(0)- super().__init__(visible_tasks_limit)+ super().__init__("Downloads", visible_tasks_limit)def get_queue_length(self) -> int:"""Returns the number of tasks in the downloader queue."""diff --git a/cyberdrop_dl/ui/progress/scraping_progress.py b/cyberdrop_dl/ui/progress/scraping_progress.pyindex b49f873e0..409714b87 100644--- a/cyberdrop_dl/ui/progress/scraping_progress.py+++ b/cyberdrop_dl/ui/progress/scraping_progress.py@@ -15,13 +15,12 @@ if TYPE_CHECKING:class ScrapingProgress(DequeProgress):"""Class that manages the download progress of individual files."""- title = "Scraping"type_str = "URLs"def __init__(self, visible_tasks_limit: int, manager: Manager) -> None:self.manager = managerself.progress = Progress(SpinnerColumn(), "[progress.description]{task.description}")- super().__init__(visible_tasks_limit)+ super().__init__("Scraping", visible_tasks_limit)def get_queue_length(self) -> int:"""Returns the number of tasks in the scraper queue."""