Skip to content

Instantly share code, notes, and snippets.

@noodlebug
Forked from stengland/bbcradio.sh
Last active February 23, 2021 14:03
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save noodlebug/0e5e3754f4e8dbf608e72431b9c34484 to your computer and use it in GitHub Desktop.
Save noodlebug/0e5e3754f4e8dbf608e72431b9c34484 to your computer and use it in GitHub Desktop.
Play BBC Radio with mpd or mplayer from the command line
#!/bin/bash
play() {
playlist="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_$1_mf_p"
echo $playlist
if mpc
then
echo "Using mpc"
mpc add $playlist
mpc play
else
echo "Using mplayer"
mplayer -msglevel all=0 $playlist
fi
}
if [ -z "$1" ]; then
echo "Select a station:"
select s in radio_one radio_two radio_three radio_fourfm radio_four_extra radio_five_live radio_five_live_sports_extra 6music
do
play ${s##* }
break
done
else
play $1
fi
@szylkrecik
Copy link

Thank you for your effort.

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