Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resuming video from where you last left off not working with Audio-only playback enabled under some conditions #2

Open
przemo20 opened this issue Nov 20, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@przemo20
Copy link

przemo20 commented Nov 20, 2024

Hi, like the title says, if you have Audio-only playback mode already activated, then – on the YouTube page – click on the video you haven't watched fully, it will start autoplaying (in the audio only mode), but from the start, instead from the timestamp.

Example steps to reproduce (you can choose any video):

  1. Visit https://www.youtube.com/watch?v=ZDMSCfol3HM
  2. If audio only playback mode is already enabled, disable it (just to make sure)
  3. Go to like 5:00 minute timestamp in the video, then let it play for a couple of seconds, then enable the audio only mode and wait for the “video” to load (off-topic: I'm not sure why it takes so long to buffer the audio track with longer videos; I'm guessing it has to “download” the entire track – not exactly the entire, but if you're at like 20 minutes timestamp, then it needs to download the first 20 minutes of audio – rather than just a segment of it).
  4. When the video starts playing again (in the audio mode only), go to https://www.youtube.com/feed/history – you should see there this video and if you hover over it – the link should have &t=301s appended to it.
  5. Click on that video on the YouTube history page – it should start autoplaying (in the audio only mode) at 0:00 timestamp, instead of 5:01 (or whatever).

Those are the steps that are pretty consistent if you want to reproduce this bug – but I'm pretty sure I stumbled on it even when not clicking on a link containing the timestamp (&t=Xs), since even without this, YT remembers at what time you stopped watching the video – but I'm not sure if I was clicking on, e.g. https://www.youtube.com/watch?v=ZDMSCfol3HM link somewhere on the YT page, or I just pasted it into address bar / clicked on a saved bookmark to go there (I can't seem to reproduce this way).

The reason why I'm reporting this is that a couple of times already I went back to finish watching some video, but I still had audio only playback mode enabled (from the last session or whatever), and the video started from 0:00, then the last watched timestamp got automatically reset (on YT servers), and even if I reloaded the video page (I don't remember them having the timestamp value appended in the URL), it still started from 0:00. So yeah, I didn't know at what timestamp I stopped watching the video.

Technical information

Browser: Firefox 132.0.2 (64-bit)
Extension version: 27

@schdie
Copy link
Owner

schdie commented Nov 21, 2024

Hi, thank you for your detailed explanation.

A couple of things before the actual problem, the source of the yt player is usually a video that works in a specific way, this extension changes the source of that video for an audio track of said video (if available) that has to be validated to use with the player, getting a specific time on that audio track is not as straight forward, normally if you are logged in with an account with good standings and the video is around or less the 10 minutes mark in length the buffering is so fast that you won't notice but if the video is hours long this does not apply. Lately Google has been doing some changes and restricting the way to get different streams from a video, currently this extensions uses the same method that yt-dlp, that means impersonating an iphone/ipad, since those streams don't need to be deciphered they are easier to work with.

I'm familiar with this bug, there are many ways to reproduce it, one common thing the yt player has no matter the source is that if it's trying to play something at a specific timestamp for some time and it fails it will reset the source and get back to 0s. I understand this is an annoying bug, using the current audio sources (iphone) one way of fixing it will be to request the URL with the current byte of the timestamp assuming it works the same way the videos do. The other option is going back to the previous method of deciphering the URL that's usually more forgiving when it comes to timestamps. Both of those options require a lot of work and testing. I'll look into it, no ETA.

@schdie schdie self-assigned this Nov 21, 2024
@schdie schdie added the bug Something isn't working label Nov 21, 2024
@przemo20
Copy link
Author

przemo20 commented Nov 21, 2024

Thanks for your reply.

Just an idea: would it be possible for the extension to remember that Audio-only playback is enabled only for the duration of the current session and only work on a tab where that mode was enabled? So, for example:

  • (What I mean by “current session”)
    I turn on the Audio only playback mode on some video/playlist/etc., then after some time I close the browser – then the next time I launch the browser I would like for this mode to be reset to OFF.
  • (What I mean by “only work on a tab (...)”)
    I turn the Audio only mode on some video that is playing in tab 1, then if I open some video in a new tab – tab 2 – then I would like for that video to play in the normal mode, but if I switch back to tab 1 and play yet another video, it would play in the audio only mode.

I'm not saying this should be the default behavior of how the extension / Audio only mode works – maybe some people like how it behaves now, and love it because of this – but there could be maybe a setting you can flip to change its behavior (though currently the extension doesn't have settings page, so this could be problematic too).

I think, this way the number of times the video resets to 0:00 would reduce, since you don't need to remember whether you still have Audio-only playback mode enabled from the last time.

Not sure if that would be possible, or if this would require a lot of work. And, also like you mentioned, a lot of testing.

@schdie
Copy link
Owner

schdie commented Nov 21, 2024

Fixing the bug should make everything else work as expected. As for adding options and whatnot that's not happening because the original idea of the extension was just to make the player not render the video to save battery using the least amount of code possible, originally that was as easy as to grab the googlevideo's URL and we were done, then Google started to progressively lock their video streams, there's a real chance the extension won't even work in the near future if Google decides to either force ciphering and/or randomizes the ciphering in a way that forces constant updates to the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants