mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-21 05:44:02 -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:
parent
4194d253c0
commit
6508688e88
2 changed files with 20 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue