Created
September 20, 2013 12:28
Convert BBC Radio playlists to use with mpd. e.g. on raspberry pi or other linux device
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
playlistdir=/var/lib/mpd/playlists | |
declare -A radios | |
radios["BBC Radio 4"]="http://www.bbc.co.uk/radio/listen/live/r4_aaclca.pls" | |
radios["BBC Radio 2"]="http://www.bbc.co.uk/radio/listen/live/r2_aaclca.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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment