Veremos nesta dica, um script bacana para ouvir rádios Web pelo terminal, em qualquer distribuição, desde que o
MPlayer ou
VLC estejam instalados e já devidamente traduzido para pt_BR, e um pouco modificados em relação ao script original.
Cole o conteúdo abaixo em um novo arquivo, salvem com um nome de sua escolha, aqui escolhi:
radio-select.sh
#!/bin/bash
#
# script original: http://arpinux.org/livarp/forum/viewtopic.php?f=19&t=17
#
####################################################
# cli_radio
# based on IceFox radio-select script
# <http://www.linuxtrack.com/t1214-radioselect-sh.htm>
####################################################
# Esquema de cores
RED='\e[41m'
BLUE='\e[44m'
CYAN='\e[46m'
NC='\e[0m'
# Especificando o player a ser utilizado.
PLAYER="/usr/bin/mplayer"
#PLAYER="/usr/bin/cvlc"
# Verificando se o $PLAYER está instalado
if [ -e $PLAYER ]; then
# parando a sessão $PLAYER
if [ "$(pidof mplayer)" ]; then
killall mplayer
fi
while true; do
clear
echo ""
echo " ·····················································"
echo " · Selecione uma estação para ouvi-la ·"
echo " · ·"
echo -e " · $CYAN[space]$NC PAUSA, $CYAN[q]$NC PARA, $CYAN[Ctrl]+[c]$NC SAI ·"
echo " ·····················································"
echo ""
echo " ·····················································"
echo -e " · $BLUE 1 $NC Addict Alternative $BLUE 2 $NC Addict Lounge ·"
echo -e " · $BLUE 3 $NC Addict Rock $BLUE 4 $NC Addict Star ·"
echo -e " · $BLUE 5 $NC Best-Hits $BLUE 6 $NC Best-Dance ·"
echo -e " · $BLUE 7 $NC BFM $BLUE 8 $NC Contact FM ·"
echo -e " · $BLUE 9 $NC FG DJ Radio $BLUE 10 $NC FG Underground ·"
echo -e " · $BLUE 11 $NC FG Vintage $BLUE 12 $NC Fréquence Jazz ·"
echo -e " · $BLUE 13 $NC Fun Radio $BLUE 14 $NC NRJ ·"
echo -e " · $BLUE 15 $NC Radio Gerard $BLUE 16 $NC Radio Nova ·"
echo -e " · $BLUE 17 $NC RTL $BLUE 18 $NC RTL2 ·"
echo -e " · $BLUE 19 $NC FIP $BLUE 20 $NC RockRadio1 ·"
echo -e " · $BLUE 21 $NC Gods Forsaken Radio $BLUE 22 $NC Power Prog Radio·"
echo -e " · $BLUE 23 $NC Personalize... $BLUE 24 $NC Personalize... ·"
echo -e " · $BLUE 25 $NC Personalize... $BLUE 26 $NC Personalize... ·"
echo " ·····················································"
echo ""
echo -e " Selecione um $BLUE número $NC de 1 a 26 e tecle $CYAN[ENTER]$NC"
echo ""
read choix
case $choix in
1)
$PLAYER http://stream1.addictradio.net/addictalternative.mp3
;;
2)
$PLAYER http://stream1.addictradio.net/addictlounge.mp3
;;
3)
$PLAYER http://stream1.addictradio.net/addictrock.mp3
;;
4)
$PLAYER http://stream1.addictradio.net/addictstar.mp3
;;
5)
$PLAYER http://sv1.vestaradio.com:9500
;;
6)
$PLAYER http://sv1.vestaradio.com:7420
;;
7)
$PLAYER http://vipicecast.yacast.net/bfm
;;
8)
$PLAYER http://broadcast.infomaniak.ch/radio-contact-high.mp3
;;
9)
$PLAYER http://fg.impek.tv/listen.pls
;;
10)
$PLAYER http://ufg.impek.tv/listen.pls
;;
11)
$PLAYER http://fgv.impek.tv/listen.pls
;;
12)
$PLAYER http://broadcast.infomaniak.ch/frequencejazz-high.mp3
;;
13)
$PLAYER http://streaming.radio.funradio.fr:80/fun-1-44-128
;;
14)
$PLAYER http://mp3.live.tv-radio.com/nrj/all/nrj_113225.mp3
;;
15)
$PLAYER http://www.mistercouzin.net:8000/listen.pls
;;
16)
$PLAYER http://broadcast.infomaniak.net/radionova-high.mp3
;;
17)
$PLAYER http://streaming.radio.rtl.fr/rtl-1-44-96
;;
18)
$PLAYER http://streaming.radio.rtl2.fr:80/rtl2-1-44-96
;;
19)
$PLAYER http://www.tv-radio.com/station/fip_mp3/fip_mp3-128k.m3u
;;
20)
$PLAYER http://87.98.146.216/castcontrol/playlist.php?port=8000
;;
21)
$PLAYER http://mixstream.net/stream/usa3-vn/8922/play.pls
;;
22)
$PLAYER http://www.powerprogradio.net/playlist/main/playlist.pls
;;
23)
echo ""
echo "Insira um link de outra rádio aqui"
echo ""
read customlink
$PLAYER $customlink
;;
24)
echo ""
echo "Insira um link de outra rádio aqui"
echo ""
read customlink
$PLAYER $customlink
;;
25)
echo ""
echo "Insira um link de outra rádio aqui"
echo ""
read customlink
$PLAYER $customlink
;;
26)
echo ""
echo "Insira um link de outra rádio aqui"
echo ""
read customlink
$PLAYER $customlink
;;
*)
echo -e "$RED Escolha errada! $NC"
echo "tente novamente..."
echo ""
sleep 2
clear
;;
esac
done
else
echo " Este script requer a instalação do MPplayer ou VLC"
echo " Instale-os ou modifique o player padrão"
echo " saindo..."
exit 0
fi
Após salvar e fechar o arquivo, dê-lhe permissão de execução e mova-o para "/usr/local/bin", ou para um diretório que esteja incluído em seu
$PATH:
chmod +x radio-select.sh
$ sudo mv radio-select.sh /usr/local/bin/
$ radio-select.sh
E abaixo, o vejam em ação e com duas das rádios que eu adicionei ao mesmo:
Ouvindo a rádio Power Prog Radio:
Ouvindo a rádio RockRadio1:
Caso queiram substituir o MPlayer pelo VLC sem interface gráfica, alterem no script, a linha PLAYER de:
PLAYER="/usr/bin/mplayer"
#PLAYER="/usr/bin/cvlc"
Para:
#PLAYER="/usr/bin/mplayer"
PLAYER="/usr/bin/cvlc"
Não recomendo, pois o VLC não é rico em informações como o MPlayer, embora funcione a contento.
Referências
@nickmarinho, Opa brother compartilha com a gente, seja aqui no VOL, no pastebin, afinal conhecimento nunca é D+
um abraço.