youtube-local icon indicating copy to clipboard operation
youtube-local copied to clipboard

[FR] Remember playback position

Open God-damnit-all opened this issue 2 years ago • 7 comments

Invidious has a very nice feature called "Save playback position" (which admittedly does bug out sometimes), and it's very convenient if something like a browser crash occurs or I have to perform a reboot.

It would be nice if youtube-local could implement something similar.

God-damnit-all avatar Nov 13 '22 16:11 God-damnit-all

If this is equivalent to getting the direct link for the video with the current timestamp included, I second this! :)

(awesome project by the way!)

AaronStiff avatar May 19 '23 00:05 AaronStiff

If this is equivalent to getting the direct link for the video with the current timestamp included, I second this! :)

(awesome project by the way!)

Thank you @AaronStiff zrose added a way to do this by pressing the 't' hotkey

user234683 avatar May 19 '23 06:05 user234683

If this is equivalent to getting the direct link for the video with the current timestamp included, I second this! :) (awesome project by the way!)

Thank you @AaronStiff zrose added a way to do this by pressing the 't' hotkey

Really? Nothing happens when I push 't'.

God-damnit-all avatar May 19 '23 13:05 God-damnit-all

Oh neat!

@ImportTaste pause the video, press 't', and the link with a timestamp is copied to your clipboard.

AaronStiff avatar May 19 '23 15:05 AaronStiff

Oh neat!

@ImportTaste pause the video, press 't', and the link with a timestamp is copied to your clipboard.

Doesn't work for me, even when I explicitly set Clipboard permissions to allow. Is there any console message for this event? Then I'd be able to tell if it's a problem with the hotkey even being registered.


EDIT: Ah, I see, there is a video hotkeys setting that I didn't have enabled, handy.

There is no console logging for the hotkeys being pressed though, that should really be changed for debugging purposes.

God-damnit-all avatar May 19 '23 20:05 God-damnit-all

Sharing a timestamp is nice, but what really needs to exist is a way to continue the video from its last location. I have a couple of videos that are over one hour, and I only watch 10 minutes or so, and when I come back to it it's really hard to find where I was last time.

Hezkore avatar Oct 25 '23 07:10 Hezkore

Proposed implementation:

  • Add a setting for enabling/disabling automatic playback position saving
  • Add a setting for the minimum video length to enable position saving (default: 15 minutes)
  • To watch.py, add a new POST request endpoint, perhaps '/save_playback_position?video_id=...&pos=...' which will write to a json file in the settings.data_dir directory. Probably better to use a sqlite database coupled with an export feature for all of these sorts of things, but that can be done later.
  • If settings are right, add an event listener in watch.js upon pausing the video, which will do an XHR request to that endpoint
  • In watch.py, have it read that file and get the duration, and set the time_start variable to that

user234683 avatar Jan 21 '24 01:01 user234683