Did a bit of digging this morning and this is the best I’ve come up with so far. I think there should be higher quality feeds available but I haven’t got them to work with the script yet.
#!/bin/bash
set -e
playlistdir=/var/lib/mpd/music/WEBRADIO
printf “Generating BBC playlists…”
declare -A radios
radios[“Default”]=“http://www.radiofeeds.co.uk/bbcradio4fm.pls”
radios[“BBC Radio 1”]=“http://www.radiofeeds.co.uk/bbcradio1.pls”
radios[“BBC Radio 2”]=“http://www.radiofeeds.co.uk/bbcradio2.pls”
radios[“BBC Radio 3”]=“http://www.radiofeeds.co.uk/bbcradio3.pls”
radios[“BBC Radio 4”]=“http://www.radiofeeds.co.uk/bbcradio4fm.pls”
radios[“BBC Radio 5 Live”]=“http://www.radiofeeds.co.uk/bbc5live.pls”
radios[“BBC Radio 5 Live SX”]=“http://www.radiofeeds.co.uk/bbc5livesportsextra.pls”
radios[“BBC 6 Music”]=“http://www.radiofeeds.co.uk/bbc6music.pls”
for k in “${!radios[@]}”
do
filepath="${playlistdir}/${k}.m3u"
rm -f “$filepath”
echo “#EXTM3U” >> “$filepath”
pls=${radios[$k]}
echo “#EXTINF:-1, BBC - $k” >> “$filepath”
curl -s $pls | grep File1 | sed ‘s/File1=(.*)/\1/’ >> “$filepath”
done
printf “… generated\n”
Did a bit of digging this morning and this is the best I’ve come up with so far. I think there should be higher quality feeds available but I haven’t got them to work with the script yet.
#!/bin/bash
set -e
playlistdir=/var/lib/mpd/music/WEBRADIO
printf “Generating BBC playlists…”
declare -A radios
radios[“Default”]=“http://www.radiofeeds.co.uk/bbcradio4fm.pls”
radios[“BBC Radio 1”]=“http://www.radiofeeds.co.uk/bbcradio1.pls”
radios[“BBC Radio 2”]=“http://www.radiofeeds.co.uk/bbcradio2.pls”
radios[“BBC Radio 3”]=“http://www.radiofeeds.co.uk/bbcradio3.pls”
radios[“BBC Radio 4”]=“http://www.radiofeeds.co.uk/bbcradio4fm.pls”
radios[“BBC Radio 5 Live”]=“http://www.radiofeeds.co.uk/bbc5live.pls”
radios[“BBC Radio 5 Live SX”]=“http://www.radiofeeds.co.uk/bbc5livesportsextra.pls”
radios[“BBC 6 Music”]=“http://www.radiofeeds.co.uk/bbc6music.pls”
for k in “${!radios[@]}”
do
filepath="${playlistdir}/${k}.m3u"
rm -f “$filepath”
echo “#EXTM3U” >> “$filepath”
pls=${radios[$k]}
echo “#EXTINF:-1, BBC - $k” >> “$filepath”
curl -s $pls | grep File1 | sed ‘s/File1=(.*)/\1/’ >> “$filepath”
done
printf “… generated\n”
Brilliant! Works perfectly, thanks.
Just used the script tonight and got BBC radio back up and running on the Pi. Thanks for your time and effort in finding solution.
You’ve done nothing wrong, there is a typo on line 10 of the original script where the URL for Radio 4 Extra is meant to be encapsulated in double quotes, but the closing one is a ‘$’ by mistake and is missing the ‘pls’ from the end. Change th ‘$’ at the end of this line to '.pls" ’ in your script and it should run fine and create files for each radio station are created in /var/lib/mpd/music/WEBRADIO
Unfortunately it won’t work since the BBC have changed how they stream their audio.
how exactly do I run this script?
I have volumio on my pi and I’d like to listen to 6 music but serching web radio doent bring it up
You don’t … this is for a very old version of Volumio.
‘Browse’, ‘Webradio’, click on options (far right) for ‘My Web Radios’, ‘Add Webradio’, and enter the following stream for BBC Radio 6:
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_6music_mf_p
Enjoy