diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index de66cb4827..a375282f23 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1660,6 +1660,10 @@ def float_or_none(v, scale=1, invscale=1, default=None): return default +def strip_or_none(v): + return None if v is None else v.strip() + + def parse_duration(s): if not isinstance(s, compat_basestring): return None