-
-
Save zetok/7382965 to your computer and use it in GitHub Desktop.
This file contains 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://www.bbc.co.uk/radio/listen/live/r"$1"_aaclca.pls" | |
if mpc | |
then | |
curl -s $playlist | grep File1 | sed 's/File1=\(.*\)/\1/' | xargs mpc add | |
mpc play | |
else | |
mplayer_args="-cache 5120 -cache-min 1 -playlist $playlist" | |
mplayer $mplayer_args || mplayer2 $mplayer_args | |
fi | |
} | |
if [ -z "$1" ]; then | |
echo "Select a station:" | |
select s in 1 2 3 4 "5 Live 5l" 6 1x 4x "5 Live sports extra 5lsp" "Asian Network an" | |
do | |
play ${s##* } | |
break | |
done | |
else | |
play $1 | |
fi | |
# GistID: 4052479 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment