You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ytdlp source: playback 403s because range is sent as a query param, not a Range header #345
ytdlp source playback (introduced ~4.8.0) fails almost every track with a 403 during streaming, thrown from YoutubePersistentHttpStream (via YtdlpAudioTrack.process), even though the URL yt-dlp extracted is valid and playable.
Root cause (reproduced)
YoutubePersistentHttpStream overrides useHeadersForRange() to return false, so range requests are sent as a range=<start>-<end>query parameter appended to the googlevideo.com URL instead of a normal Range: header. YouTube's CDN now rejects that query-param form with 403, while a standard Range: header on the exact same URL succeeds.
Verified directly against the URL yt-dlp itself returned for a track (filesize/ext etc. all present, so this isn't an extraction failure):
Same URL, same server/IP, same request otherwise — User-Agent doesn't matter either (tested with yt-dlp's own reported http_headers.User-Agent, a plain Apache-HttpClient-style UA, and no UA at all; all three return 403 with the query-param form and 206 with the header form).
This looks like a leftover from an older youtube-source technique for avoiding CDN throttling that YouTube has since started blocking outright — the same anti-bot shift that's currently breaking dev.lavalink.youtube (lavalink-devs/youtube-source#216, #217).
Lavalink logs
ERROR --- [back-1-thread-1] c.s.d.l.t.p.LocalAudioTrackExecutor : Error in playback of <videoId>
com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Something broke when playing the track.
Caused by: java.lang.RuntimeException: Not success status code: 403
at com.github.topi314.lavasrc.ytdlp.YtdlpAudioTrack.process(YtdlpAudioTrack.java:61)
To Reproduce
Configure the ytdlp LavaSrc source (plugins.lavasrc.sources.ytdlp: true) as the sole YouTube playback path.
Play basically any non-live YouTube track.
Playback starts loading, then fails partway through with the 403 above.
YoutubePersistentHttpStream.useHeadersForRange() should return true (or the override should be removed entirely, falling back to the parent PersistentHttpStream's header-based ranging).
Activity