From fb21b75e679374729065cbcf9360ddc5caf47ba8 Mon Sep 17 00:00:00 2001 From: Kade Date: Thu, 27 Jul 2017 16:51:55 -0400 Subject: [PATCH] make sure upload_date is only fallback to timestamp --- youtube_dl/YoutubeDL.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 200e4917f..671fb399d 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1454,7 +1454,8 @@ class YoutubeDL(object): upload_date = datetime.datetime.utcfromtimestamp(info_dict['timestamp']) except (ValueError, OverflowError, OSError): pass - elif info_dict.get('upload_date') is not None: + # should only occur if timestamp didn't exist + if upload_date is None and info_dict.get('upload_date') is not None: try: upload_date = datetime.datetime.strptime(info_dict['upload_date'], '%Y%m%d') except (ValueError, OverflowError, OSError):