Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
Allow adding CacheDuration to datetime and timedelta values
Jacobfea5a17a0cb4
diff --git a/cyberdrop_dl/config_definitions/custom_types.py b/cyberdrop_dl/config_definitions/custom_types.pyindex 909d88f0c..c24eb3a42 100644--- a/cyberdrop_dl/config_definitions/custom_types.py+++ b/cyberdrop_dl/config_definitions/custom_types.py@@ -1,6 +1,6 @@from __future__ import annotations-from datetime import timedelta+from datetime import datetime, timedeltafrom typing import Annotatedimport humanfriendly@@ -145,3 +145,8 @@ class CacheDuration(BaseModel):return humanfriendly.format_timespan(self.total_seconds(), detailed=False)elif isinstance(self.duration, timedelta):return humanfriendly.format_timespan(self.duration.total_seconds(), detailed=False)++ def __radd__(self, other):+ if isinstance(other, datetime) or isinstance(other, timedelta):+ return other + self.duration+ return NotImplemented