Browse Source

radio: прослушивание радио

master
Maxim Lihachev 10 years ago
parent
commit
4e70c42e3c
  1. 27
      radio

27
radio

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
#!/bin/sh
#Сценарий прослушивания радиостанций
#Формат списка: name;playlist
STATIONS=$SHELLRC/etc/soft/radio/stations
plays() {
echo $1
PLAYLIST=$(cat $STATIONS | grep "$1" | cut -d ';' -f 2)
echo $PLAYLIST | grep 'http'
if [ $? -eq 0 ]; then
killall play 2>/dev/null
STREAM=$(curl -s $PLAYLIST | grep 'http://' | sed 's/^.*http/http/' | head -n 1)
curl -s $STREAM | play -q -t mp3 -
fi
}
CH=$(cat $STATIONS | cut -d ';' -f 1 | dmenu -fn '-*-fixed-*-*-*-*-15-*-*-*-*-*-*-*' -l 10)
case $CH in
STOP) killall play 2>/dev/null;;
*) plays "$CH";;
esac
Loading…
Cancel
Save