X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Futils.py;h=1081a93680c7dc1d054748bcffd68cca50cf6b28;hb=696d49815e082402be65c4f120397b4695477279;hp=9b94407f41f10cd90f6249583a2ffd9583002fee;hpb=40a90862f49f89bdfcd6feea5340538efc2b6a5c;p=youtube-dl diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 9b94407f4..1081a9368 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -827,6 +827,7 @@ def unified_strdate(date_str): '%b %dnd %Y %I:%M%p', '%b %dth %Y %I:%M%p', '%Y-%m-%d', + '%Y/%m/%d', '%d.%m.%Y', '%d/%m/%Y', '%Y/%m/%d %H:%M:%S', @@ -1273,8 +1274,11 @@ def int_or_none(v, scale=1, default=None, get_attr=None, invscale=1): if get_attr: if v is not None: v = getattr(v, get_attr, None) + if v == '': + v = None return default if v is None else (int(v) * invscale // scale) + def str_or_none(v, default=None): return default if v is None else compat_str(v)