Repository navigation
feat(play): queue YouTube radio links and start playback faster - #10
Merged
Merged
Conversation
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
watch?v=…&list=RD…) now queues the radio's first 25 songs as a playlist. Before, thev=parameter made it play only the seed video./playno longer runs two full yt-dlp extractions back to back. Resolution extracts once (yt-dlp -J), caches the info JSON in memory, and the stream starts from it through--load-info-json -. Measured first audio byte: 0.67 s cached vs 4.99 s fresh.Changes
packages/server/src/lib/youtube.tsisRadioUrlandRADIO_TRACK_LIMIT = 25packages/server/src/lib/infoCache.tspackages/server/src/index.ts--playlist-end 25;getVideoInfoextracts with-Jand caches;createAudioStreamstreams from the cache and falls back to a fresh extractionREADME.mdodd/tasks/youtube-radio-fast-start.mdDesign notes
watch?v=X&list=PL…still plays the single video;playlist?list=RD…is rejected by YouTube ("This playlist type is unviewable"), so only thewatchform counts as a radio.Test plan
bun test: 84 pass, 0 fail (newisRadioUrlandinfoCachecases)bun build src/index.ts --target bun: exit 0--playlist-end 25→ 25 entries in 1.8 s; first audio byte 0.67 s cached vs 4.99 s fresh/playwith a single YouTube link,/playwith a radio linkKnown limitations
cover them and the gap between songs.
already failed to play with the same format selector.
Stacked on
fix/queue-reset-on-leave; merge that one first.