From db7cfbf9255e3f4554380227d6bee26f94470ac3 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Mon, 29 Apr 2024 04:42:32 +0200 Subject: [PATCH] allow to start URLs with offset see https://www.w3.org/TR/media-frags/ --- cplay.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cplay.py b/cplay.py index 02886a4..4e8e304 100644 --- a/cplay.py +++ b/cplay.py @@ -218,6 +218,9 @@ def _play(self): def play(self, path): self.path = path self.position = 0 + if path.startswith('http') and '#t=' in path: + _, offset = path.split('#t=', 1) + self.position = float(offset) self.length = 0 self._seek_step = 0 self._play()