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:
parent
9500e5e7a2
commit
fb21b75e67
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user