mirror of
https://github.com/blackjack4494/yt-dlc.git
synced 2024-12-23 08:17:00 +00:00
[utils] Make parse_duration case insensitive
This commit is contained in:
parent
f7a361c4f1
commit
f164038b79
1 changed files with 1 additions and 1 deletions
|
@ -1336,7 +1336,7 @@ def parse_duration(s):
|
||||||
s = s.strip()
|
s = s.strip()
|
||||||
|
|
||||||
m = re.match(
|
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:
|
if not m:
|
||||||
return None
|
return None
|
||||||
res = int(m.group('secs'))
|
res = int(m.group('secs'))
|
||||||
|
|
Loading…
Reference in a new issue