Tag Archives: mp3

AmazonMP3 and Linux – Clamz

Amazon’s MP3 download store is a very well stocked and typically well priced source for your MP3 music needs. The files free of DRM and are offered up a nice quality without having to pay extra like with iTunes Plus.

In order to download all songs in a single go and receive the full album discount, you need to use the AmazonMP3 download client. The great bit is that a Linux client is offered, and there are several versions packaged up for various distributions, however, these are often hit or miss. There are usually workarounds and methods to get the dependencies you need, but there is a better solution.

Clamz is the hands down way to go. Free and open source, Clamz is a great command line client to download your AMZ files (the full album versions of the downloads).

Head to Clamz project page linked to above, compile and install as usual, and then head over to this link to activate Clamz with your browser.

Now you can One-Click buy your albums. You’ll receive the AMZ file for download which you can then grab your music with something simple like:

mkdir new_album && cd new_album && clamz [thefile].amz

Besides the simple grab as highlighted above, you can do a few other things with Clamz:

$ clamz --help
Usage: clamz [options] amz-file ...
General options:
 -o, --output=NAME:       write output to file NAME (may contain
                          variables, see below)
 -d, --output-dir=DIR:    write output to directory DIR (may also
                          contain variables)
 -r, --resume:            resume a partial download
 -i, --info:              show info about AMZ-files; do not download
                          any tracks
 -x, --xml:               output XML data from AMZ-files; do not download
                          any tracks
 -v, --verbose:           display detailed information
 -q, --quiet:             don't display non-critical messages
 --help:                  display this help
 --version:               display program version

Output options:
 --allow-chars=CHARS:     allow filenames containing CHARS
 --forbid-chars=CHARS:    forbid filenames containing CHARS
 --allow-uppercase:       allow uppercase letters in filenames
 --forbid-uppercase:      forbid uppercase letters in filenames
 --utf8-filenames:        allow UTF-8 filenames
 --ascii-filenames:       force ASCII-only filenames

Filenames (-o, -d) may contain the following variables:
 ${title} ${creator} ${album} ${tracknum} ${album_artist} ${genre}
 ${discnum} ${suffix} ${asin} ${album_asin}

As you can see, Clamz gives you a lot of power over your downloads that you don’t have with the Amazon client [note: it's been a year or two since I've used the Amazon client, things may be different now]. This inevitably leaves you with the ability to create batch processing of your AMZ files if you are downloading a lot of music in a single go. Just download all your AMZ files and then create a simple shell script around Clamz to download all your files to corresponding directories. Splitting out to proper directories could easily be done by reading in parts of the AMZ XML using Clamz with the –xml switch and grabbing any information you might want to use.

Clamz is a must have for those that purchase music from Amazon.  Fast, simple, and essentially foolproof.