Skip to content

Commit

Permalink
second version of lastfmfad
Browse files Browse the repository at this point in the history
  • Loading branch information
JacK_McRiDER authored and JacK_McRiDER committed Apr 28, 2011
1 parent 8d217e3 commit 9bebfb7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
23 changes: 23 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 7 additions & 3 deletions lastfmfad
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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!"

0 comments on commit 9bebfb7

Please sign in to comment.