Skip to content

Commit 009360f

Browse files
committed
plugins.twitch: Also support hours for VOD offset.
1 parent 8a7c77c commit 009360f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/livestreamer/plugins/twitch.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212

1313

1414
def time_to_offset(t):
15-
match = re.match(r"((?P<minutes>\d+)m)?((?P<seconds>\d+)s)?", t)
15+
match = re.match(r"((?P<hours>\d+)h)?((?P<minutes>\d+)m)?((?P<seconds>\d+)s)?", t)
1616
if match:
17-
offset = int(match.group("minutes") or "0") * 60
17+
offset = int(match.group("hours") or "0") * 60 * 60
18+
offset += int(match.group("minutes") or "0") * 60
1819
offset += int(match.group("seconds") or "0")
1920
else:
2021
offset = 0

0 commit comments

Comments
 (0)