Last active
June 24, 2019 19:16
-
-
Save fernandes/9442984 to your computer and use it in GitHub Desktop.
Download all playlists from di.fm
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/sh | |
# Adapted from http://mpd.wikia.com/wiki/Hack:di.fm-playlists | |
URL="http://listen.di.fm/public3" | |
token=$1; dir=$2 | |
if [ "$dir" == "" -o "$token" == "" ]; then | |
echo "Usage: $0 TOKEN PATH_TO_SAVE" | |
echo "Example: $0 0123456789abcdef0 /var/lib/mpd/playlists" | |
echo "Dont know your TOKEN? Access: http://www.di.fm/member/listen_key" | |
echo "" | |
echo "All playlists are 256k" | |
exit | |
fi | |
for name in `wget -q -nv -O - ${URL} | grep -o '"key":"[^"]*"' | sed 's/"key":"\([^"]*\)"/\1/g'`; do | |
echo "Downloading.. ${name}" | |
file="$dir/di-${name}.pls" | |
wget -q -nv -O $file "http://listen.di.fm/premium_high/${name}.pls?${token}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Word!