1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-25 03:53:00 +08:00

make sure upload_date is only fallback to timestamp

This commit is contained in:
Kade 2017-07-27 16:51:55 -04:00 committed by GitHub
parent 9500e5e7a2
commit fb21b75e67

View File

@ -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):