Skip to content

Bulk asynchronous downloader for multiple file hosts

fix: async get size (#1486)

NTFSvolume68aa898f50da
diff --git a/cyberdrop_dl/utils/aio.py b/cyberdrop_dl/utils/aio.py
index ca37321f0..5ee01cde7 100644
--- a/cyberdrop_dl/utils/aio.py
+++ b/cyberdrop_dl/utils/aio.py
@@ -4,11 +4,11 @@ from __future__ import annotations
import asyncio
import builtins
-import pathlib
from stat import S_ISREG
from typing import TYPE_CHECKING, ParamSpec, TypeVar, cast
if TYPE_CHECKING:
+ import pathlib
from collections.abc import Awaitable, Sequence
_P = ParamSpec("_P")
@@ -70,11 +70,7 @@ async def get_size(path: pathlib.Path) -> int | None:
try:
stat_result = await stat(path)
- except OSError as e:
- if not pathlib._ignore_error(e): # type: ignore[reportAttributeAccessIssue]
- raise
- return
- except ValueError:
+ except (OSError, ValueError):
return
else:
if S_ISREG(stat_result.st_mode):