fix info extracting expired to use epoch as it is the ended instead of timestamp.

This commit is contained in:
arabcoders 2025-08-25 17:50:47 +03:00
parent 19b9f8dc6c
commit 30830a94e8

View file

@ -229,7 +229,7 @@ class Download:
# Safe-guard incase downloading take too long and the info expires.
if self.info_dict and isinstance(self.info_dict, dict) and self.download_info_expires > 0:
_ts: int | None = self.info_dict.get("timestamp")
_ts: int | None = self.info_dict.get("epoch", self.info_dict.get("timestamp", None))
_ts = datetime.fromtimestamp(_ts, tz=UTC) if _ts else None
if not _ts or (datetime.now(tz=UTC) - _ts).total_seconds() > self.download_info_expires:
self.info_dict = None