| 1 | #!/bin/sh |
| 2 | #Copylefted by Harvie 2o12 |
| 3 | #Generates M3U playlist for di.fm and sky.fm |
| 4 | #Tip: I am running this from cron at OpenWRT router with soundcard and MPD |
| 5 | |
| 6 | get_playlist() { |
| 7 | echo "#Playlist generated from $1 @ $(date)" |
| 8 | wget "$1" -O - | grep -o 'http://[^"]*' | while read line; do |
| 9 | echo $(wget "$line" -O - | grep -o 'http://.*$' | grep '[a-zA-Z0-9]$' | head -n 1)?${line##*/} |
| 10 | done |
| 11 | } |
| 12 | |
| 13 | get_playlist http://listen.di.fm/public3 > /root/playlists/di.fm.m3u |
| 14 | get_playlist http://listen.sky.fm/public3 > /root/playlists/sky.fm.m3u |