lavaplayer icon indicating copy to clipboard operation
lavaplayer copied to clipboard

YouTube streams and videos longer than 6 hours stop playing

Open web-dev-4926 opened this issue 1 year ago • 4 comments

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

  1. Play a YouTube stream that is guaranteed to run for more than 6 hours, HERE is the stream used for the test
  2. 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)

web-dev-4926 avatar Mar 22 '24 02:03 web-dev-4926

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 image 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 :( )

N1C0exe avatar Apr 17 '24 19:04 N1C0exe

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.

devoxin avatar Apr 17 '24 19:04 devoxin

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 :)

N1C0exe avatar Apr 18 '24 08:04 N1C0exe

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.

devoxin avatar Apr 22 '24 23:04 devoxin

Closing as this is now stale. If you continue to experience issues, please open another issue on the youtube-source repository.

devoxin avatar May 22 '24 15:05 devoxin