Skip to content

Bulk asynchronous downloader for multiple file hosts

test: include thumbnails in test cases

NTFSvolume7d88e57dbd40
diff --git a/cyberdrop_dl/crawlers/crawler.py b/cyberdrop_dl/crawlers/crawler.py
index 8eadcec30..249b34a73 100644
--- a/cyberdrop_dl/crawlers/crawler.py
+++ b/cyberdrop_dl/crawlers/crawler.py
@@ -991,6 +991,8 @@ class Crawler(HTTPMixin, HLSMixin, ABC):
class API(HTTPMixin, ABC):
PRIMARY_URL: AbsoluteHttpURL = AbsoluteHttpURL()
# We inherit from ABC to force type checkers to recognize attributes defined in __post_init__ as if they were defined in __init__
+ #
+ log: _CrawlerLogger
class Endpoint[T: API](ABC): # noqa: B024
def __init__(self, api: T) -> None:
@@ -1045,6 +1047,7 @@ class API(HTTPMixin, ABC):
)
self.PRIMARY_URL = crawler.PRIMARY_URL # pyright: ignore[reportConstantRedefinition]
self.parse_url = crawler.parse_url
+ self.log = crawler.log
self.__http_config__ = config # pyright: ignore[reportAttributeAccessIssue]
return self
diff --git a/scripts/tools/make_test_cases.py b/scripts/tools/make_test_cases.py
index fa0a7098a..ff3828766 100644
--- a/scripts/tools/make_test_cases.py
+++ b/scripts/tools/make_test_cases.py
@@ -15,7 +15,17 @@ from cyberdrop_dl.crawlers import SKIP_DOWNLOAD
if TYPE_CHECKING:
from collections.abc import Generator
-KEYS = ("url", "filename", "debrid_url", "original_filename", "referer", "album_id", "uploaded_at", "download_folder")
+KEYS = (
+ "url",
+ "filename",
+ "debrid_url",
+ "original_filename",
+ "referer",
+ "album_id",
+ "uploaded_at",
+ "download_folder",
+ "thumbnail",
+)
ROOT = Path(__file__).resolve().parents[2]
TEST_FOLDER = ROOT / "tests/crawlers/test_cases"
diff --git a/tests/crawlers/test_cases/__init__.py b/tests/crawlers/test_cases/__init__.py
index 81a6b6481..9f866c490 100644
--- a/tests/crawlers/test_cases/__init__.py
+++ b/tests/crawlers/test_cases/__init__.py
@@ -17,6 +17,7 @@ class Result(TypedDict):
album_id: NotRequired[str | type | None]
uploaded_at: NotRequired[int | type | None]
download_folder: NotRequired[str | type]
+ thumbnail: NotRequired[str | type]
@dataclasses.dataclass(slots=True)