From: Harvie Date: Sun, 15 Jan 2012 15:37:52 +0000 (+0100) Subject: DI.fm/SKY.fm playlist generator for MPD :-) X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=03d228c5a868ba9f1c614f8c7d3e73bf06349d9d;p=mirrors%2FPrograms.git DI.fm/SKY.fm playlist generator for MPD :-) --- diff --git a/bash/di.fm.sh b/bash/di.fm.sh new file mode 100755 index 0000000..8046934 --- /dev/null +++ b/bash/di.fm.sh @@ -0,0 +1,14 @@ +#!/bin/sh +#Copylefted by Harvie 2o12 +#Generates M3U playlist for di.fm and sky.fm +#Tip: I am running this from cron at OpenWRT router with soundcard and MPD + +get_playlist() { + echo "#Playlist generated from $1 @ $(date)" + wget "$1" -O - | grep -o 'http://[^"]*' | while read line; do + echo $(wget "$line" -O - | grep -o 'http://.*$' | grep '[a-zA-Z0-9]$' | head -n 1)?${line##*/} + done +} + +get_playlist http://listen.di.fm/public3 > /root/playlists/di.fm.m3u +get_playlist http://listen.sky.fm/public3 > /root/playlists/sky.fm.m3u