Skip to content

Commit

Permalink
allow to start URLs with offset
Browse files Browse the repository at this point in the history
  • Loading branch information
xi committed Apr 29, 2024
1 parent db1031e commit db7cfbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit db7cfbf

Please sign in to comment.