From 03d228c5a868ba9f1c614f8c7d3e73bf06349d9d Mon Sep 17 00:00:00 2001 From: Harvie Date: Sun, 15 Jan 2012 16:37:52 +0100 Subject: [PATCH] DI.fm/SKY.fm playlist generator for MPD :-) --- bash/di.fm.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bash/di.fm.sh 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 -- 2.30.2