v.ytdl_sub_keep_files_date_eval

This commit is contained in:
e1ven 2025-11-17 18:52:54 -04:00
parent 8435783058
commit 11745cb877

View file

@ -680,11 +680,11 @@ class EnhancedDownloadArchive:
# Set mtime if preserve_mtime is enabled and we have an entry with upload_date
if preserve_mtime and entry and not self._file_handler.dry_run:
upload_date = entry.get(v.upload_date, str)
upload_date = entry.get(v.ytdl_sub_keep_files_date_eval, str)
if upload_date:
try:
# Convert YYYYMMDD to timestamp
upload_datetime = datetime.strptime(upload_date, "%Y%m%d")
# Convert YYYY-mm-dd to timestamp
upload_datetime = datetime.strptime(upload_date, "%Y-%m-%d")
upload_timestamp = time.mktime(upload_datetime.timetuple())
# Set mtime on the output file