YouTube streams and videos longer than 6 hours stop playing
Versions
- Lavalink v4.0..4
- JVM v17.0.9
- Lavaplayer v2.1.1
Description
When playing a YouTube stream / video that has a duration of 6 hours or more, a "TrackEndEvent" with a generic "finished" event is emitted, with no errors present in the logs
I have done tests using both a stream as well as a regular video that has a duration of 10 hours, both produce the exact same outcome
Steps to Reproduce
Below is a list of steps I have done to reproduce this issue, demonstrating that the stream / video ends at exactly 6 hours after initially playing
- Play a YouTube stream that is guaranteed to run for more than 6 hours, HERE is the stream used for the test
- Keep the stream running for at least 6 hours
Log Output and Assumptions
Output
HERE is a gobin containing the log of the test, I cut out most of it to be able to store it because the entire log output was too large
Assumptions
I believe this is because of a query parameter called "expire" present in the google video link found on line 87 in the gobin link (i redacted the host ip address from the link)
The value of this query parameter is a unix timestamp in seconds. After parsing the timestamp the time given is (Thursday, March 21, 2024 8:57:23 PM EDT) which is consistent with the log output
The "TrackStartEvent" is logged on line 84 at (2024-03-21T14:57:22.320-04:00)
The "TrackEndEvent" is logged on line 109 at (2024-03-21T20:57:27.379-04:00)
Hey some days ago I saw ( while I was playing a live video from yt ) that the music suddenly stop . Today I saw your post on the Lavalink Discord server . So I went back to my Discord channel and I found this
Exactly 6 hours . 99% the same issue . And this happened several times ( now I know that I'm not alone xD )
YouTube Link of the stream : https://www.youtube.com/watch?v=A-Ja3fXfpuM (Sorry but I'cant retrive Lavalink logs :( )
This is because the googlevideo playback URLs expire after 6 hours. This should be fixed with the release of my upcoming rewritten YouTube source manager.
This is because the googlevideo playback URLs expire after 6 hours. This should be fixed with the release of my upcoming rewritten YouTube source manager.
Thanks devox :)
Before I transfer this issue to youtube-source, are you able to try the new youtube source? This issue should be resolved for videos. Livestreams are still a WIP as they need to be handled a little differently.
Closing as this is now stale. If you continue to experience issues, please open another issue on the youtube-source repository.