Skip to content

Improve YouTube livestream playback for radio stations#5

Merged
luongnv89 merged 1 commit intoluongnv89:mainfrom
kylephillipsau:feat/youtube-radio-support
Jan 6, 2026
Merged

Improve YouTube livestream playback for radio stations#5
luongnv89 merged 1 commit intoluongnv89:mainfrom
kylephillipsau:feat/youtube-radio-support

Conversation

@kylephillipsau
Copy link
Contributor

G'day!

I saw your posts about music-cli on X and finally got around to checking it out - really love it! I wanted to listen to Anjunadeep Radio while coding, so I added it as a radio station.

I noticed intermittent dropouts when playing YouTube livestreams, so I improved the playback by piping yt-dlp directly to ffplay. This handles HLS buffering and reconnections much more reliably. Should work great for YouTube live streams like Anjunadeep Radio, Monstercat, lofi hip hop study streams, etc.

What this does

  • Radio stations can now use YouTube URLs directly
  • Uses yt-dlp piped to ffplay for reliable HLS streaming (Unix)
  • Falls back to direct URL playback on Windows
  • YouTube stations hidden if yt-dlp isn't installed
  • Added Anjunadeep Radio to Electronic section as an example

Tested

  • YouTube radio playback works without dropouts
  • Switching stations cleans up processes properly
  • Regular radio stations unaffected

- Radio stations can now use YouTube URLs (live streams work well)
- Uses yt-dlp pipe to ffplay for reliable HLS streaming on Unix
- Falls back to direct URL playback on Windows
- Properly cleans up process groups when stopping playback
- Add Anjunadeep Radio (YouTube live stream) to Electronic section
- YouTube stations are hidden if yt-dlp is not installed
@luongnv89
Copy link
Owner

Code Review

Great contribution! This PR effectively addresses the YouTube livestream dropout issue by piping yt-dlp directly to ffplay, which handles HLS buffering and reconnections much more reliably.

Highlights:

  • Clean implementation with proper fallback for Windows
  • Good use of shlex.quote() for shell command security
  • Smart filtering of YouTube stations when yt-dlp isn't installed
  • Proper process group management for cleanup

The addition of Anjunadeep Radio as an example station is a nice touch for testing the feature.

Thanks for the contribution!

@luongnv89 luongnv89 merged commit 4966126 into luongnv89:main Jan 6, 2026
luongnv89 added a commit that referenced this pull request Jan 12, 2026
Improve YouTube livestream playback for radio stations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants