Created
November 26, 2011 13:12
-
-
Save apnof/1395648 to your computer and use it in GitHub Desktop.
Get http://www.commoradio.net/ playlists.
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/bash | |
PROGNAME=${0##*/} | |
if ! [ $# -eq 1 ] | |
then | |
echo -e "ERROR:\twrong parameter count." | |
echo -e "\tNeed to know which playlist to download." | |
echo -e "Usage:\t$PROGNAME c64|amiga|mix" | |
echo -e "\tc64 =\tStone Oakvalleys Authentic SID Collection (SOASC=)" | |
echo -e "\t\thttp://www.6581-8580.com/" | |
echo -e "\tamiga =\tStone Oakvalleys Amiga Music Collection (SOAMC=)" | |
echo -e "\t\thttp://www.paula8364.com/" | |
echo -e "\tmix =\tMix of the two above." | |
echo -e "Alternative: Take a look at http://www.commoradio.net/" | |
exit 1 | |
fi | |
TARGETDIR=$(mktemp -d) | |
TARGETFILE=${PROGNAME%.*} | |
case "$1" in | |
"c64") | |
# echo "Debug: c64" | |
URL="http://fonix.dyndns.org:40000/commoradio/sys64738.php?b=soasc" | |
;; | |
"amiga") | |
# echo "Debug: amiga" | |
URL="http://fonix.dyndns.org:40000/commoradio/sys64738.php?b=soamc" | |
;; | |
"mix") | |
# echo "Debug: mix" | |
URL="http://fonix.dyndns.org:40000/commoradio/sys64738.php" | |
;; | |
*) | |
echo "ERROR: wrong parameter." | |
exit 2 | |
;; | |
esac | |
OUTSUFFIX="$1" | |
OUTPUT="${TARGETDIR}/${TARGETFILE}_${OUTSUFFIX}.m3u" | |
if wget -q -O ${OUTPUT} ${URL} | |
then | |
echo "${OUTPUT}" | |
else | |
echo "ERROR: Problem retrieving playlist from server." | |
exit 3 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment