Created
August 13, 2012 21:20
-
-
Save cstroie/3344182 to your computer and use it in GitHub Desktop.
Create playlists with all available stations of sky.fm, di.fm and JazzRadio and send them by email
This file contains hidden or 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/sh | |
# Create playlists with all available stations of sky.fm, di.fm and JazzRadio and send them by email | |
# Create all playlists | |
for station in sky di jazz | |
do | |
for format in mp3 aac | |
do | |
`dirname $0`/radio2playlist $station $format | |
done | |
done | |
# Email them to | |
ls -l `dirname $0`/*.m3u | mutt -x -s "Radio playlists" -a `dirname $0`/*.m3u -- [email protected] |
This file contains hidden or 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/sh | |
# Create playlists with all available stations of sky.fm, di.fm and JazzRadio | |
# Select the station | |
if [ "$1" == "sky" ] | |
then | |
station="$1" | |
server="listen.sky.fm" | |
elif [ "$1" == "di" ] | |
then | |
station="$1" | |
server="listen.di.fm" | |
elif [ "$1" == "jazz" ] | |
then | |
station="$1" | |
server="listen.jazzradio.com" | |
else | |
echo "Unknown station." | |
exit 1 | |
fi | |
shift 1 | |
# Select the format | |
if [ "$1" == "mp3" ] | |
then | |
format="$1" | |
pathinfo="public3" | |
elif [ "$1" == "aac" ] | |
then | |
format="$1" | |
pathinfo="public1" | |
else | |
echo "Unknown format." | |
exit 2 | |
fi | |
shift 1 | |
# Download | |
wget -q -O - "http://$server/$pathinfo" | grep -o '"playlist":"[^"]*"' | sed 's/"playlist":"\([^"]*\)"/\1/g' | sort | xargs -n 1 wget -q -O - | sed -n 's/^File1=//p' > "$station"-"$format".m3u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment