Linux.com

Home Learn Linux Linux Tutorials Get Your Music Fix From Amazon MP3 on Linux with Clamz

Get Your Music Fix From Amazon MP3 on Linux with Clamz

 

Music loving Linux users take note: Though Amazon hasn't updated its Linux downloader for Amazon MP3 in ages, you can still get your MP3 fix off Amazon using clamz.

Amazon MP3 offers a really good selection of DRM-free music, including a fairly hefty selection of free songs and sampler albums. But Linux users have been getting the short end of the stick from Amazon lately, because the retail giant rarely updates the MP3 download client for Linux. That's not a big deal if you're just buying a single song, but it's a prerequisite for downloading Amazon albums.

Unless you're running Ubuntu 9.04, Fedora 11, or openSUSE 11.1 (all of which are past or nearly past their support lifecycle), you're out in the cold. Or are you? Linux users have at least two options for getting their MP3 fix from Amazon: recent releases of Banshee with Amazon MP3 Store support, and clamz. Since many Linux users already have a favorite media player, we'll take a look at clamz and how you can use it to take the place of the official Amazon downloader.

The other nice thing about clamz is that it's Free software, released under the GNU General Public License version 3 (GPLv3).

Getting and Using clamz

Most distributions do not package clamz, though it is available in the Ubuntu 10.10 repos. To get clamz, just run sudo apt-get install clamz, and you'll be set.

But if you need to compile clamz, make sure that you have libgcrypt, libcurl, and libexpat and their development packages installed. Once you have those, all you need to do is to uncompress the most recent tarball and cd to the source directory.

Then you'll run ./configure, and make. Assuming those complete without errors, run sudo make install, like so:


cd clamz-0.X
./configure && make
sudo make install

All good? Fantastic! Now it's time to start with the downloads. Because of the way that Amazon's downloads work, you need to complete an extra step to get it to work with your browser.

Go to the after download manager install page on Amazon, and it will register clamz properly with your browser. You may have to repeat this if you use two (or more) browsers. If you're using Chrome or Chromium, it will download the .amz file rather than pass it to clamz — even though the file type is properly associated with clamz. To fix this, click the arrow next to the file on the downloads bar (at the bottom of the Chrome/Chromium window) and select Always Open Files of this Type.

Advantages of clamz

Or don't, if you prefer you can use clamz to manually download songs like so:

clamz AmazonMP3-1278274782.amz

The number following AmazonMP3 is specific to the download, of course, so change that to the appropriate filename.

Here's where clamz outshines the native Amazon downloader. First, it keeps acopy of the .amz file under ~/.clamz/amzfiles. The native downloader deletes the files after it downloads the songs. Be sure to keep a copy of these, in case you lose your MP3s! I shouldn't have to add this, but I will: Don't share the .amz files with anyone else. One, it's not legal. Two, it'd be giving Amazon an incentive to try to obfuscate further the .amz format and make it harder for Linux users to use clamz. We really don't want to do that. Third? I suspect strongly that Amazon includes identifying information in the .amz files, so you probably don't want to be doing any illicit sharing there.

If you run clamz --help or man clamz, you'll see that it has a bevy of options. I won't go into all of them, but I do want to point out a couple of them. First, the -i option will display the info about an .amz file to standard out. So you can see what album an particular file is associated with by using clamz -i AmazonMP3-number.amz.

Want to change the default directory or filenames that clamz uses when writing the files? The -o (output) and -d (output directory) options support a bunch of variables like the track numbers, artists, genre, album title, and so forth.

But who wants to have to specify those on the command line every time you buy an album? Not me! But like all sane *nix applications, clamz has its very own config file that you can use to specify these options just once and use every time.

The file is ~/.clamz/config and you can use that to modify the format of the filenames, the output directory, and more. I've left most everything the same, but I wanted to modify the default output directory to live under my Dropbox directory:


OutputDir       "/home/jzb/Dropbox/clamz/${album_artist}/${album}"

As you can see, clamz will copy files to a "clamz" directory under Dropbox, and then create a directory for the album artist and the album name. You can use any of the supported variables here — so if you prefer to sort files by genre, use ${genre}.

That should be more than enough to get started. Poke around the man page if you want to do more with clamz.

A big kudos to the clamz developers. It's a simple utility that makes life just a little bit better, and helps put Linux users on par with Windows and Mac users. It's too bad Amazon doesn't treat Linux users as first class citizens with its tools, but the community will provide.

Of course, Amazon isn't the only game in town. Ubuntu users have the Ubuntu One music store, which has a similar selection and pricing to the Amazon MP3 store. There's also Magnatune, which is a label for independent artists and has a really large selection of interesting music. If you want the latest Lady Gaga, you'll not find it there. But if you want some excellent world music, classical, or indie alt rock and hip hop, check out Magnatune. All of their stuff is available under a CC license, and you can listen to everything before you buy.

You'll also find interesting stuff over at CD Baby. Again, mostly indie music — but lots of really good stuff.

Have a favorite Linux-friendly music source? Please share it in the comments!

 

Comments

Subscribe to Comments Feed
  • G Said:

    Ah, thank you, precisely the info I needed.


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board