Skip to content

Instantly share code, notes, and snippets.

@denysvitali
Last active June 24, 2022 07:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denysvitali/a5bdd453702c0956a8de7021781f40e1 to your computer and use it in GitHub Desktop.
Save denysvitali/a5bdd453702c0956a8de7021781f40e1 to your computer and use it in GitHub Desktop.
Play Music from Live YT Stream (Sonos)

Play Music from Youtube Live Stream

Requirements

Running

streamlink --hls-live-edge=`date "+%M*60/2+%S/2" | bc` https://www.youtube.com/watch\?v\=b3NtpSc5RNw best --stdout | ffmpeg -i pipe:0 -q:a 0 -map a -f mp3 pipe:1 | vlc -

Play Music from Youtube Live Stream to Sonos

streamlink --hls-live-edge=`date "+%M*60/2+%S/2" | bc` https://www.youtube.com/watch\?v\=b3NtpSc5RNw best --stdout | ffmpeg -i pipe:0 -q:a 0 -map a -f mp3 pipe:1 | vlc -vvv - --sout '#standard{access=http,mux=mp3,dst=0.0.0.0:8080}'

then play with your Sonos speaker:

x-rincon-mp3radio://192.168.1.199:8080

where 192.168.1.199 is your IP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment