From 2db806b4aa0047002cf4c8b1ce6e3dd79ab8ee69 Mon Sep 17 00:00:00 2001 From: "Sergey M." Date: Mon, 17 Feb 2014 03:46:26 +0700 Subject: Improve parse_duration --- youtube_dl/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'youtube_dl/utils.py') diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index dd03f058f..a192a420a 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1144,7 +1144,7 @@ def parse_duration(s): return None m = re.match( - r'(?:(?:(?P[0-9]+):)?(?P[0-9]+):)?(?P[0-9]+)$', s) + r'(?:(?:(?P[0-9]+)[:h])?(?P[0-9]+)[:m])?(?P[0-9]+)s?$', s) if not m: return None res = int(m.group('secs')) -- cgit v1.2.3