Skip to content

Instantly share code, notes, and snippets.

@EarlGray
Created September 19, 2016 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EarlGray/d64514459892650881353a465c4b9a05 to your computer and use it in GitHub Desktop.
Save EarlGray/d64514459892650881353a465c4b9a05 to your computer and use it in GitHub Desktop.
#!/bin/bash
PLAYER=mplayer
PLAYER_OPTIONS=-prefer-ipv4
while getopts "gch" opt; do
case $opt in
g) PLAYER=smplayer
export DISPLAY=:0
;;
c)
PLAYER_OPTIONS="$PLAYER_OPTIONS -ao pcm:file=cap.wav"
;;
h)
echo "Usage: $0 <channel|*.m3u|*.pls>"
echo " channels are: roks|ahfm|difm|anty"
exit
;;
esac
done
shift $(($OPTIND-1))
case $1 in
roks) STATION='http://online-radioroks.tavrmedia.ua:8000/RadioROKS' ;;
ahfm) STATION='http://ua.ah.fm:9010' ;;
difm) STATION='http://pub1.di.fm:80/di_trance' ;;
anty) STATION='http://ant-waw-01.cdn.eurozet.pl:8602/' ;;
*.m3u) STATION="`cat $1 | egrep -v '^#|^$'`" ;;
*.pls) STATION="`grep File1 "$1" | sed 's/File1=//'`" ;;
*) echo "Unknown station: $1"
exit 1
;;
esac
exec $PLAYER $PLAYER_OPTIONS $STATION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment