Page 1 of 1

easy-peasy radio script

Posted: Tue Feb 25, 2014 7:47 am
by machinebacon
You probably already know that I am sucker for 'dialog's in terminals. The following script needs a file in which you paste your favourite radio stream URLs

/usr/local/bin/bbqownradio

Code: Select all

#!/bin/bash
# BBQOWNRADIO
. /usr/share/doc/dialog/examples/setup-vars
. /usr/share/doc/dialog/examples/setup-tempfile

ar=()
while read n s ; do
	ar+=($n "$s")
done < /usr/local/share/radiolist

dialog --clear --cancel-label "OFF" --menu "Stations" 0 0 0 "${ar[@]}" 2> $tempfile
retval=$?
case $retval in
	$DIALOG_CANCEL)
		killall mpg123 ; exit 0;;
esac
mpg123 -C -q -@ `cat $tempfile` &
reset
clear
echo "Now playing: `cat $tempfile`"
exit 0
and here is a sample file you can use as radiolist - no blank lines please!

/usr/local/share/radiolist

Code: Select all

http://mp3-live.swr.de/swr1bw_s.m3u 
http://4broadcast.de/radioin.m3u 
http://tranceradio.ch/listen.m3u 
http://voxsc1.somafm.com:8600 
http://www.friskyradio.com/frisky.m3u  
http://shouthostdirect13.streams.bassdrive.com:8202 
http://streamer-dtc-aa03.somafm.com:80/stream/1018 
http://broadcast.infomaniak.ch/traxx002-low.mp3 
http://broadcast.informaniak.ch/traxx003-low.mp 
http://broadcast.informaniak.ch/traxx013-low.mp3 
http://voxsc1.somafm.com:8300 
http://voxsc1.somafm.com:8384 
http://voxsc1.somafm.com:7000 
http://voxsc1.somafm.com:8040 
http://voxsc1.somafm.com:8062 
http://voxsc1.somafm.com:8700 
http://voxsc1.somafm.com:8900 
http://voxsc1.somafm.com:8500 
http://voxsc1.somafm.com:8090 
http://voxsc1.somafm.com:2200 
http://voxsc1.somafm.com:8880 
http://webradio.radiof.de:8000/ 
http://www.dradio.de/streaming/dlf.m3u 
http://205.164.62.21:8030/ 
http://www.coolradio.de/streams/cooljazz-128.m3u 
http://www.jazzradio.net/docs/stream/jazzradio.pls 
http://ams02.egihosting.com:5050/ 
http://air.radiolla.com/radiolla192k 
http://air.radiolla.com/jiraffe192k 
http://air.radiolla.com/volta192k 
http://air.radiolla.com/equalyza192k 
http://air.radiolla.com/ilma192k 
Remember: sudo chmod a+x /usr/local/bin/bbqownradio

some random list: <removed due to bitching>

Re: easy-peasy radio script

Posted: Fri May 02, 2014 12:51 pm
by brontosaurusrex
Thanks for sharing this, I have added some buffering to the mpg123 line (-b 2000), but otherwise working as expected.

Re: easy-peasy radio script

Posted: Wed May 14, 2014 2:06 pm
by johnraff
[all he can do is poke holes in other peoples' work]

1)

Code: Select all

ar=()
while read n s ; do
   ar+=($n "$s")
done < /usr/local/share/radiolist
I can't see any $n values appearing - radiolist only has 1 word per line - or am I missing something?

2)
no blank lines please!
http://link_removed has one. Image

Re: easy-peasy radio script

Posted: Thu May 15, 2014 8:22 am
by rhowaldt
^ :D

Re: easy-peasy radio script

Posted: Thu May 15, 2014 1:50 pm
by johnraff
@mb Thanks for all those streams though. Now to hack up a little thing to go through them all picking out the ones I want "next, next, next...OK, next..."

Re: easy-peasy radio script

Posted: Wed May 21, 2014 8:31 am
by machinebacon
johnraff wrote:[all he can do is poke holes in other peoples' work]

1)

Code: Select all

ar=()
while read n s ; do
   ar+=($n "$s")
done < /usr/local/share/radiolist
I can't see any $n values appearing - radiolist only has 1 word per line - or am I missing something?

2)
no blank lines please!
http://link-removed has one. Image
1) you can add a name in front, if you have time. I didn't ;)
2) removed list from server, thanks for the info.

Re: easy-peasy radio script

Posted: Wed May 21, 2014 8:31 am
by machinebacon
brontosaurusrex wrote:Thanks for sharing this, I have added some buffering to the mpg123 line (-b 2000), but otherwise working as expected.
Thanks for the info, I haven't played with buffering values yet.

Re: easy-peasy radio script

Posted: Wed May 28, 2014 5:32 am
by johnraff
machinebacon wrote:removed list from server
Lucky I grabbed it quickly.
Recently some more nice radio stations seem to be appearing. I'll have to post a few of my favourites on that thread...