Skip to content

Bulk asynchronous downloader for multiple file hosts

fix: include `pywin32` on Windows (#1751)

NTFSvolume1a07a2094fbe
diff --git a/cyberdrop_dl/__main__.py b/cyberdrop_dl/__main__.py
index b0066f624..c59e9e33d 100644
--- a/cyberdrop_dl/__main__.py
+++ b/cyberdrop_dl/__main__.py
@@ -4,7 +4,7 @@ import sys
from collections.abc import Sequence
from typing import Annotated
-from cyclopts import App, Parameter
+from cyclopts import App, CycloptsPanel, Parameter
from cyberdrop_dl import __version__, aio, program_ui, tracebacks, webhook
@@ -133,7 +133,11 @@ def show() -> None:
def main(args: Sequence[str] | None = None) -> None:
with setup_console_logging():
- app(args)
+ try:
+ app(args)
+ except* ValueError as exc_group:
+ msg = "\n" + "\n".join(map(str, exc_group.exceptions))
+ app.console.print(CycloptsPanel(msg, title=exc_group.message))
if __name__ == "__main__":
diff --git a/cyberdrop_dl/utils/apprise.py b/cyberdrop_dl/utils/apprise.py
index 6f1407fd2..5c2a9b4df 100644
--- a/cyberdrop_dl/utils/apprise.py
+++ b/cyberdrop_dl/utils/apprise.py
@@ -8,6 +8,8 @@ import importlib.util
import logging
from typing import TYPE_CHECKING
+from pydantic import ValidationError
+
from cyberdrop_dl import aio
from cyberdrop_dl.logs import MAIN_LOG_FILE, borrow_logger, export_logs, log_spacer
from cyberdrop_dl.models import AppriseURL
@@ -53,7 +55,18 @@ def _parse_apprise_url(*urls: str) -> tuple[AppriseURL, ...]:
logger.warning("Found apprise URLs for notifications but apprise is not installed. Ignoring")
return ()
- return tuple(AppriseURL.model_validate({"url": url}) for url in set(urls))
+ models: list[AppriseURL] = []
+ errors: list[ValueError] = []
+ for url in dict.fromkeys(urls):
+ try:
+ models.append(AppriseURL.model_validate({"url": url}))
+ except ValidationError as e:
+ errors.append(ValueError(f"Not a valid apprise URL: {e.errors(include_url=False)[0]['input']}"))
+
+ if errors:
+ raise BaseExceptionGroup("Invalid Apprise file", errors)
+
+ return tuple(models)
async def send_notifications(urls: Sequence[AppriseURL], body: str) -> None:
diff --git a/pyproject.toml b/pyproject.toml
index 086950b12..21da6cfd7 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -55,10 +55,9 @@ version = "9.4.1"
[project.optional-dependencies]
apprise = [
- "apprise >=1.10.0"
-]
-extras = [
- "apprise >=1.10.0"
+ "apprise >=1.10.0",
+ 'pywin32>=311; platform_system == "Windows"',
+ 'tzdata>=2025.3; platform_system == "Windows"'
]
[project.scripts]
diff --git a/uv.lock b/uv.lock
index 31fca2d4f..e3ea2c877 100644
--- a/uv.lock
+++ b/uv.lock
@@ -2,9 +2,12 @@ version = 1
revision = 3
requires-python = ">=3.11"
resolution-markers = [
- "python_full_version >= '3.14'",
- "python_full_version == '3.13.*'",
- "python_full_version < '3.13'",
+ "python_full_version >= '3.14' and sys_platform == 'win32'",
+ "python_full_version >= '3.14' and sys_platform != 'win32'",
+ "python_full_version == '3.13.*' and sys_platform == 'win32'",
+ "python_full_version == '3.13.*' and sys_platform != 'win32'",
+ "python_full_version < '3.13' and sys_platform == 'win32'",
+ "python_full_version < '3.13' and sys_platform != 'win32'",
]
[[package]]
@@ -12,7 +15,7 @@ name = "aiodns"
version = "4.0.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
- { name = "pycares" },
+ { name = "pycares", marker = "sys_platform != 'win32'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/10/da/97235e953109936bfeda62c1f9f1a7c5652d4dc49f2b5911f9ae1043afa9/aiodns-4.0.0.tar.gz", hash = "sha256:17be26a936ba788c849ba5fd20e0ba69d8c46e6273e846eb5430eae2630ce5b1", size = 26204, upload-time = "2026-01-10T22:33:27.211Z" }
wheels = [
@@ -758,9 +761,8 @@ dependencies = [
[package.optional-dependencies]
apprise = [
{ name = "apprise" },
-]
-extras = [
- { name = "apprise" },
+ { name = "pywin32", marker = "sys_platform == 'win32'" },
+ { name = "tzdata", marker = "sys_platform == 'win32'" },
]
[package.dev-dependencies]
@@ -780,7 +782,6 @@ requires-dist = [
{ name = "aiolimiter", specifier = ">=1.2.1" },
{ name = "aiosqlite", specifier = ">=0.22.1" },
{ name = "apprise", marker = "extra == 'apprise'", specifier = ">=1.10.0" },
- { name = "apprise", marker = "extra == 'extras'", specifier = ">=1.10.0" },
{ name = "async-mega-py", specifier = ">=2.3.1" },
{ name = "backports-zstd", marker = "python_full_version < '3.14' and platform_python_implementation == 'CPython'" },
{ name = "beautifulsoup4", specifier = ">=4.14.3" },
@@ -798,15 +799,17 @@ requires-dist = [
{ name = "psutil", marker = "sys_platform != 'android'", specifier = ">=7.2.1" },
{ name = "pycryptodome", specifier = ">=3.23.0" },
{ name = "pydantic", specifier = ">=2.13.1" },
+ { name = "pywin32", marker = "sys_platform == 'win32' and extra == 'apprise'", specifier = ">=311" },
{ name = "pyyaml", specifier = ">=6.0.3" },
{ name = "readchar", specifier = ">=4.2.2" },
{ name = "rich", specifier = ">=15.0.0" },
{ name = "send2trash", specifier = ">=2.0.0" },
{ name = "truststore", specifier = ">=0.10.4" },
+ { name = "tzdata", marker = "sys_platform == 'win32' and extra == 'apprise'", specifier = ">=2025.3" },
{ name = "xxhash", specifier = ">=3.7.0" },
{ name = "yarl", specifier = ">=1.23.0" },
]
-provides-extras = ["apprise", "extras"]
+provides-extras = ["apprise"]
[package.metadata.requires-dev]
dev = [
@@ -1410,7 +1413,7 @@ name = "pycares"
version = "5.0.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
- { name = "cffi" },
+ { name = "cffi", marker = "sys_platform != 'win32'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/df/a0/9c823651872e6a0face3f0311de2a40c8bbcb9c8dcb15680bd019ac56ac7/pycares-5.0.1.tar.gz", hash = "sha256:5a3c249c830432631439815f9a818463416f2a8cbdb1e988e78757de9ae75081", size = 652222, upload-time = "2026-01-01T12:37:00.604Z" }
wheels = [
@@ -1699,6 +1702,25 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/d8/db/795879cc3ddfe338599bddea6388cc5100b088db0a4caf6e6c1af1c27e04/python_discovery-1.2.2-py3-none-any.whl", hash = "sha256:e1ae95d9af875e78f15e19aed0c6137ab1bb49c200f21f5061786490c9585c7a", size = 31894, upload-time = "2026-04-07T17:28:48.09Z" },
]
+[[package]]
+name = "pywin32"
+version = "311"
+source = { registry = "https://pypi.org/simple" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/7c/af/449a6a91e5d6db51420875c54f6aff7c97a86a3b13a0b4f1a5c13b988de3/pywin32-311-cp311-cp311-win32.whl", hash = "sha256:184eb5e436dea364dcd3d2316d577d625c0351bf237c4e9a5fabbcfa5a58b151", size = 8697031, upload-time = "2025-07-14T20:13:13.266Z" },
+ { url = "https://files.pythonhosted.org/packages/51/8f/9bb81dd5bb77d22243d33c8397f09377056d5c687aa6d4042bea7fbf8364/pywin32-311-cp311-cp311-win_amd64.whl", hash = "sha256:3ce80b34b22b17ccbd937a6e78e7225d80c52f5ab9940fe0506a1a16f3dab503", size = 9508308, upload-time = "2025-07-14T20:13:15.147Z" },
+ { url = "https://files.pythonhosted.org/packages/44/7b/9c2ab54f74a138c491aba1b1cd0795ba61f144c711daea84a88b63dc0f6c/pywin32-311-cp311-cp311-win_arm64.whl", hash = "sha256:a733f1388e1a842abb67ffa8e7aad0e70ac519e09b0f6a784e65a136ec7cefd2", size = 8703930, upload-time = "2025-07-14T20:13:16.945Z" },
+ { url = "https://files.pythonhosted.org/packages/e7/ab/01ea1943d4eba0f850c3c61e78e8dd59757ff815ff3ccd0a84de5f541f42/pywin32-311-cp312-cp312-win32.whl", hash = "sha256:750ec6e621af2b948540032557b10a2d43b0cee2ae9758c54154d711cc852d31", size = 8706543, upload-time = "2025-07-14T20:13:20.765Z" },
+ { url = "https://files.pythonhosted.org/packages/d1/a8/a0e8d07d4d051ec7502cd58b291ec98dcc0c3fff027caad0470b72cfcc2f/pywin32-311-cp312-cp312-win_amd64.whl", hash = "sha256:b8c095edad5c211ff31c05223658e71bf7116daa0ecf3ad85f3201ea3190d067", size = 9495040, upload-time = "2025-07-14T20:13:22.543Z" },
+ { url = "https://files.pythonhosted.org/packages/ba/3a/2ae996277b4b50f17d61f0603efd8253cb2d79cc7ae159468007b586396d/pywin32-311-cp312-cp312-win_arm64.whl", hash = "sha256:e286f46a9a39c4a18b319c28f59b61de793654af2f395c102b4f819e584b5852", size = 8710102, upload-time = "2025-07-14T20:13:24.682Z" },
+ { url = "https://files.pythonhosted.org/packages/a5/be/3fd5de0979fcb3994bfee0d65ed8ca9506a8a1260651b86174f6a86f52b3/pywin32-311-cp313-cp313-win32.whl", hash = "sha256:f95ba5a847cba10dd8c4d8fefa9f2a6cf283b8b88ed6178fa8a6c1ab16054d0d", size = 8705700, upload-time = "2025-07-14T20:13:26.471Z" },
+ { url = "https://files.pythonhosted.org/packages/e3/28/e0a1909523c6890208295a29e05c2adb2126364e289826c0a8bc7297bd5c/pywin32-311-cp313-cp313-win_amd64.whl", hash = "sha256:718a38f7e5b058e76aee1c56ddd06908116d35147e133427e59a3983f703a20d", size = 9494700, upload-time = "2025-07-14T20:13:28.243Z" },
+ { url = "https://files.pythonhosted.org/packages/04/bf/90339ac0f55726dce7d794e6d79a18a91265bdf3aa70b6b9ca52f35e022a/pywin32-311-cp313-cp313-win_arm64.whl", hash = "sha256:7b4075d959648406202d92a2310cb990fea19b535c7f4a78d3f5e10b926eeb8a", size = 8709318, upload-time = "2025-07-14T20:13:30.348Z" },
+ { url = "https://files.pythonhosted.org/packages/c9/31/097f2e132c4f16d99a22bfb777e0fd88bd8e1c634304e102f313af69ace5/pywin32-311-cp314-cp314-win32.whl", hash = "sha256:b7a2c10b93f8986666d0c803ee19b5990885872a7de910fc460f9b0c2fbf92ee", size = 8840714, upload-time = "2025-07-14T20:13:32.449Z" },
+ { url = "https://files.pythonhosted.org/packages/90/4b/07c77d8ba0e01349358082713400435347df8426208171ce297da32c313d/pywin32-311-cp314-cp314-win_amd64.whl", hash = "sha256:3aca44c046bd2ed8c90de9cb8427f581c479e594e99b5c0bb19b29c10fd6cb87", size = 9656800, upload-time = "2025-07-14T20:13:34.312Z" },
+ { url = "https://files.pythonhosted.org/packages/c0/d2/21af5c535501a7233e734b8af901574572da66fcc254cb35d0609c9080dd/pywin32-311-cp314-cp314-win_arm64.whl", hash = "sha256:a508e2d9025764a8270f93111a970e1d0fbfc33f4153b388bb649b7eec4f9b42", size = 8932540, upload-time = "2025-07-14T20:13:36.379Z" },
+]
+
[[package]]
name = "pyyaml"
version = "6.0.3"