diff options
author | Sergey M. <dstftw@gmail.com> | 2014-02-17 03:46:26 +0700 |
---|---|---|
committer | Sergey M. <dstftw@gmail.com> | 2014-02-17 03:46:26 +0700 |
commit | 2db806b4aa0047002cf4c8b1ce6e3dd79ab8ee69 (patch) | |
tree | d64b93df5c2d52222a15619a71148e9a2ab15b2d /youtube_dl/utils.py | |
parent | 3f32c0ba4c9b7d9d654588d3bb0b88e41d4a0113 (diff) |
Improve parse_duration
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
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<hours>[0-9]+):)?(?P<mins>[0-9]+):)?(?P<secs>[0-9]+)$', s) + r'(?:(?:(?P<hours>[0-9]+)[:h])?(?P<mins>[0-9]+)[:m])?(?P<secs>[0-9]+)s?$', s) if not m: return None res = int(m.group('secs')) |