Last active
January 11, 2023 14:53
-
-
Save stengland/4052479 to your computer and use it in GitHub Desktop.
Play BBC Radio with mpd or mplayer from the command line
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
#!/bin/bash | |
play() { | |
playlist="http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_$1.m3u8" | |
echo $playlist | |
if mpc | |
then | |
mpc add $playlist | |
mpc play | |
else | |
mplayer $playlist | |
fi | |
} | |
if [ -z "$1" ]; then | |
echo "Select a station:" | |
select s in radio_one radio_two radio_three radio_fourfm radio_five_live 6music | |
do | |
play ${s##* } | |
break | |
done | |
else | |
play $1 | |
fi | |
# GistID: 4052479 |
Lately for streaming radio in the UK I've had the change the URL to
playlist="http://stream.live.vc.bbcmedia.co.uk/bbc_$1"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The stream links are apparently outdated again -- for mpd, I've modified my own little script, but TL;DR:
playlist="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_$1_mf_p"
and then modify the station names in the
select
using any ofFound stream urls in this blog post.