Skip to content

Instantly share code, notes, and snippets.

@fjebaker
Last active March 3, 2021 18:13
Show Gist options
  • Save fjebaker/f89ec5356f0ce3893846d473d8417f9d to your computer and use it in GitHub Desktop.
Save fjebaker/f89ec5356f0ce3893846d473d8417f9d to your computer and use it in GitHub Desktop.
mpd BBC Radio Streams
#!/bin/bash
# station urls found in http://www.suppertime.co.uk/blogmywiki/2015/04/updated-list-of-bbc-network-radio-urls/
# script inspired by https://gist.github.com/stengland/4052479
STATIONS=(
radio1 radio1xtra radio2 radio3
radio4fm radio4lw radio4extra
radio5live 6music asianet
cymru foyle nangaidheal scotlandfm
ulster walesmw
)
playradio() {
stream_url="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_$1_mf_p"
echo "Using '$stream_url':"
# clear current queue
mpc clear
mpc add $stream_url && mpc play
}
main() {
select s in ${STATIONS[*]}; do
playradio "${s}"
break
done
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment