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:
df 2021-08-01 09:42:57 +01:00 committed by dirkf
commit 6508688e88
2 changed files with 20 additions and 1 deletions

View file

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