Script for listening shoutcast radios

Sathariel created the following script for listening any radio stream station, it requires to create the file ~/.radio, there you should save all your radio stream stations in a list with the following syntax:


You can edit this script and replace audacious for your favorite audio player, if you use a cli audio player you can remove the nohup command and the last part too (&> /dev/null &)


[[ ! -f ~/.radio ]] && echo "Configuration file not found" &&  exit 1
opts=$(awk -F'|' '
		n = 0
		s = "on"
		n += 1
		printf("%s \"%s\" %s ", n, $1, s)
		s = "off"
	' ~/.radio)
[[ -z $opts ]] && echo "Error reading configuration" && exit 1
 stream=$(echo $opts | xargs dialog --output-fd 1 --radiolist "Select a source" 10 50 10)

[[ $? -eq 0 ]] && nohup audacious $(sed -n ${stream}p ~/.radio | cut -d '|' -f 2) &> /dev/null &

Script for updating A records with shoutcast radios

Many stream radio stations changes its IP, that is the reason I created the following script, its not interactive so you should edit it, replace with the station m3u file that you can find in clicking in download and using the right bottom of mouse.

Then replace xxxxxxxxxxxxxxxxxxxxxxxxx with your Cloudflare api key, and with your Cloudflare email.

Replace aaaaaaaaaaaaaaaaaaaaaa with the zone id and bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb with the dns record (subdomain) id.

a=$(curl -s | tail -1 | cut -d "/" -f 3 | sed -e 's/:.*//g')

curl -X PUT "" \
	 -H "X-Auth-Email:" \
	 -H "X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxxx" \
	 -H "Content-Type: application/json" \
	 --data  $( echo  '{"type":"A","name":"","content":"$a","ttl":120,"proxied":false}' | sed -e "s/\$a/$a/g" )

You can run this script as a cronjob daily:

0 0 * * * bash /home/example/

You can get the zone id running this command:

curl -X GET "" \
 -H "X-Auth-Email:" \
-H "X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxxx" \
 -H "Content-Type: application/json"

And you can get the DNS record id with the following command:

curl -X GET "" \
 -H "X-Auth-Email:" \
 -H "X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json"

Where do I find my Cloudflare API Key?

These bottons respect your privacy