From 227d4822fff13ea449f11531ce54c56b2b01432b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Mon, 12 Jan 2015 21:06:26 +0600 Subject: [PATCH] [utils] Disallow non string types in parse_duration (Closes #4679) --- youtube_dl/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index deaf718030..98732e8e99 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1269,7 +1269,7 @@ def float_or_none(v, scale=1, invscale=1, default=None): def parse_duration(s): - if s is None: + if not isinstance(s, basestring if sys.version_info < (3, 0) else compat_str): return None s = s.strip()