mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-11-01 09:26:45 -07:00
Make default upload_/release_date a compat_str
Ensures download tests pass in Python 2 as well as 3; also add YoutubeDL tests for timestamp -> upload_date etc.
This commit is contained in:
@@ -1529,7 +1529,7 @@ class YoutubeDL(object):
|
||||
# see http://bugs.python.org/issue1646728)
|
||||
try:
|
||||
upload_date = datetime.datetime.utcfromtimestamp(info_dict[ts_key])
|
||||
info_dict[date_key] = upload_date.strftime('%Y%m%d')
|
||||
info_dict[date_key] = compat_str(upload_date.strftime('%Y%m%d'))
|
||||
except (ValueError, OverflowError, OSError):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user