projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7a361c
)
[utils] Make parse_duration case insensitive
author
Sergey M․
<dstftw@gmail.com>
Wed, 3 Sep 2014 14:03:36 +0000
(21:03 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Wed, 3 Sep 2014 14:03:36 +0000
(21:03 +0700)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 91afe8622984682678ae5c807b8454b9449413a3..3846dfdcad0d45af18f07eaa8ef50242d2a5abfd 100644
(file)
--- 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<hours>[0-9]+)\s*(?:[:h]|hours?)\s*)?(?P<mins>[0-9]+)\s*(?:[:m]|mins?|minutes?)\s*)?(?P<secs>[0-9]+)(?P<ms>\.[0-9]+)?\s*(?:s|secs?|seconds?)?$', s)
+ r'(?
i)(?
:(?:(?P<hours>[0-9]+)\s*(?:[:h]|hours?)\s*)?(?P<mins>[0-9]+)\s*(?:[:m]|mins?|minutes?)\s*)?(?P<secs>[0-9]+)(?P<ms>\.[0-9]+)?\s*(?:s|secs?|seconds?)?$', s)
if not m:
return None
res = int(m.group('secs'))