1
0
mirror of https://github.com/l1ving/youtube-dl synced 2020-11-18 19:53:54 -08:00

[utils] Add try error type

This commit is contained in:
Dainese Hsiao 2016-06-19 12:05:33 +08:00
parent a50fd6e026
commit f0ebaff543

View File

@ -1063,7 +1063,7 @@ def unified_strdate(date_str, day_first=True):
for expression in format_expressions:
try:
upload_date = datetime.datetime.strptime(date_str, expression).strftime('%Y%m%d')
except ValueError:
except (ValueError, TypeError):
pass
if upload_date is None:
timetuple = email.utils.parsedate_tz(date_str)