From: Sergey M․ Date: Wed, 3 Sep 2014 14:03:36 +0000 (+0700) Subject: [utils] Make parse_duration case insensitive X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=f164038b7944afb007a19b6cf1a793ee02399214;p=youtube-dl [utils] Make parse_duration case insensitive --- diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 91afe8622..3846dfdca 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1336,7 +1336,7 @@ def parse_duration(s): s = s.strip() m = re.match( - r'(?:(?:(?P[0-9]+)\s*(?:[:h]|hours?)\s*)?(?P[0-9]+)\s*(?:[:m]|mins?|minutes?)\s*)?(?P[0-9]+)(?P\.[0-9]+)?\s*(?:s|secs?|seconds?)?$', s) + r'(?i)(?:(?:(?P[0-9]+)\s*(?:[:h]|hours?)\s*)?(?P[0-9]+)\s*(?:[:m]|mins?|minutes?)\s*)?(?P[0-9]+)(?P\.[0-9]+)?\s*(?:s|secs?|seconds?)?$', s) if not m: return None res = int(m.group('secs'))