diff --git a/README b/README index e69de29..546788d 100644 --- a/README +++ b/README @@ -0,0 +1,23 @@ +----------------------------------------- +LASTFMFAD - last.fm free album downloader +----------------------------------------- + +ABOUT +----- +lastfmFAD is a little tool to download full free albums from last.fm. +On the website you have to download every single track by clicking on [free download]. With lastfmFAD you can download the whole album with one command. + +USAGE +----- +You are surfing on last.fm, maybe on a netlabels page and find a free downloadable album. +Take the albums URL, go into your commandline and do + lastfmfad 'url' +lastfmFAD will create a now directory in your working directory, called "[artist]_-_[album]" and will download all album files into it. +Don't forget to set the url into quote marks! + +INSTALL +------- +To install the script to /usr/bin just do + sudo make install + +You can also use the script file ./lastfmfad to download albums without having it installed to /usr/bin. diff --git a/lastfmfad b/lastfmfad index ffafa94..bcfbce3 100755 --- a/lastfmfad +++ b/lastfmfad @@ -9,16 +9,20 @@ fi dir=`echo $1 | sed -ne 's/.*\/\(.*\)\/\(.*\)/\1_-_\2/p'` -wget $1 -O album.tmp +echo -n "Getting download files..." +wget -q -O album.tmp $1 files=`cat album.tmp | grep mp3 | sed -ne 's/.*\(http:\/\/freedownloads\.last\.fm\/download\/.*\.mp3\).*/\1/p'` +echo " done!" for i in $files; do echo -n "Downloading $i..." - wget -P $dir -q $i + wget -P $dir -o name.tmp $i + oldname=`awk 'NR==6' name.tmp | sed -ne 's/.*\/\(.*\.mp3\).*/\1/p'` + trck=`id3v2 -l "$dir/$oldname" | grep TRCK | awk '{ print $6 }'` && mv "$dir/$oldname" "$dir/${trck}_-_${oldname}" echo " done!" done -rm album.tmp +rm album.tmp name.tmp echo -e "\nFinished getting the full album!" exit 0; diff --git a/makefile b/makefile index 370208b..5920c77 100644 --- a/makefile +++ b/makefile @@ -4,5 +4,5 @@ INAME = lastfmfad install : $(IDIR)/$(INAME) $(IDIR)/$(INAME) : $(INAME) - @echo "Installing lastfmFAD..." - @install $+ $@ && echo "...done!" + @echo -n "Installing lastfmFAD..." + @install $+ $@ && echo " done!"