Skip to content

Bulk asynchronous downloader for multiple file hosts

refactor: add check for resp serialization

NTFSvolume2a0daac57943
diff --git a/cyberdrop_dl/clients/response.py b/cyberdrop_dl/clients/response.py
index 08a44560c..7deb9ba47 100644
--- a/cyberdrop_dl/clients/response.py
+++ b/cyberdrop_dl/clients/response.py
@@ -73,6 +73,7 @@ class AbstractResponse(ABC, Generic[_ResponseT]):
_text: str = EMPTY_CONTENT
_cache: dict[str, Any] = dataclasses.field(init=False, compare=False, default_factory=dict)
_lock: asyncio.Lock = dataclasses.field(init=False, compare=False, default_factory=asyncio.Lock)
+ _serialized: bool = False
_fully_serialized: bool = False
created_at: datetime.datetime = dataclasses.field(
init=False,
@@ -99,7 +100,7 @@ class AbstractResponse(ABC, Generic[_ResponseT]):
@final
@property
def has_content_not_logged(self) -> bool:
- return not self._fully_serialized and self._text is not EMPTY_CONTENT
+ return self._serialized and not self._fully_serialized and self._text is not EMPTY_CONTENT
def __json__(self) -> dict[str, Any]:
try:
@@ -108,6 +109,7 @@ class AbstractResponse(ABC, Generic[_ResponseT]):
logger.exception("Unable to decode content of response %s", self.id)
content = "<ERROR DECODING CONTENT>"
+ self._serialized = True
if content is EMPTY_CONTENT:
content = "<DID NOT AWAIT FOR CONTENT YET>"
else: