Amazon MP3 Downloader

April 1st, 2008    (updated November 27th, 2013)

Amazon’s MP3 Download Service

Recently, Amazon introduced an MP3 music download service. The thing that sets this service apart from most others out there is that the downloads are in 256KBit MP3 format, with no Digital Restrictions Management, such as is found on iTunes, Windows Media, and Real audio files. Amazon is no saint but this is a great victory for those who want to buy music online but can’t live with giving up their rights to it.

Not only that but their prices are extremely competitive, with singles being $0.89 (or a few $0.99) and albums being $7.99 or $8.99, for the most part. I’m recommending to all my friends and family that this be the first place they look to purchase digital music (remember you can put MP3s onto your iPod too: you don’t have to be stuck with Apple’s heavily restricted AAC formats).


NEWS FLASH!!

Amazon is now providing a native download manager for Linux! That makes this page essentially obsolete! You can go get it here!


The bad news is that while Amazon’s MP3’s are not encumbered with DRM once they appear on your computer, the download process requires a proprietary bit of code called the Amazon MP3 Download Manager. Amazon provides versions of this downloader for Windows and for Apple Mac systems only. Although their FAQ says that there is a Linux version in development, it’s not available yet. Without this program you can purchase and download individual files from your Linux box, but you cannot download whole albums. Buying a complete album, which is almost always cheaper than buying the tracks one at a time (not to mention much less time consuming) is not possible on Linux.

Or at least, that’s what Amazon says.

MP3 Downloader on Linux

It turns out that Amazon’s MP3 Downloader will run in Wine (a compatibility layer that allows Windows programs to run on Linux). Although the application is not fully functional, by any means, it works well enough to get your music downloaded. Here’s how I did it on my Ubuntu 7.10 (Gutsy Gibbon) installation of Linux.

Installing Wine and the Downloader

As I was sitting down to write this I discovered that someone else had already done an excellent job of showing, with screenshots, the first steps. Rather than replicate that effort I’ll just point you to it. Once you get that done, come back here for some tips/hints/help.

Running the Downloader

You will quickly discover the bad parts of the Downloader in Wine. As I mentioned above, it’s not fully supported by any stretch: if you try to access any of the menus, etc. it will lock up hard. Not only that, but even if you run it as described above, passing it the downloaded AMZ file as an argument, it will download the music but then sit around forever in the background, leaving an icon in your notification bar. This wouldn’t be so bad except that for whatever reason it absolutely kills the interactivity of my system. Top reports my system is very busy and things like switching desktops etc. are very jerky.

And even that wouldn’t be so bad, except that the thing is very hard to kill. It starts a number of processes and you have to kill them all in order to get your system’s responsiveness back.

So, what I did was write a script, which you can download here. This script has a few nice features:

  • Makes a backup copy of the AMZ file (the download manager will always delete the copy you give it).
  • If no command line argument is given, it will invoke a file selector dialog to let you choose one.
  • After you indicate that the download is complete it will kill the downloader and all associated processes.

To use it, download the script, make it executable (chmod +x amazonmp3 or with the file browser), and put it somewhere on your PATH (I always create a $HOME/bin directory and add that to my PATH). If you like you can add a custom application launcher for this script to the panel: right-click on the panel and select “Add to Panel”. Choose “Custom Application Launcher” and choose an appropriate name, comment, and icon, and put the full path to the script in the Command: box.

Once the download manager is running you’ll see an icon for it in the notification area. If you hover over it with your mouse you’ll see it reports the percent complete of the download. You must wait until it completes, but there will be no indication other than the flyover help will no longer give a percentage. In the meantime, the script will put up a dialog for you to wait. Once you’re sure the download is complete, click the button in the dialog and the script will shut down the download manager.

Configuring FireFox

With the setup above, your procedure for buying music on Amazon’s site will be something like this: find the music and buy it. When you get a download dialog box, have the AMZ file put somewhere you’ll remember it, but don’t open it. After it’s downloaded, start the script and use the file selector to choose it. Wait for the download. Click OK.

That’s fine, but you can get slightly tighter integration with FireFox if you want to:

  • Go to FireFox’s Tools -> Add Ons, and install the MIME Edit extension for FireFox.
  • You’ll have to restart FireFox to enable it.
  • Go to the Tools menu and you’ll see a new entry, “MIME Edit…”. Select it.
  • Choose the “Edit” tab.
  • Choose the “New Type” button.
  • For the new type I used “application/amazonmp3download”, the extension should be “amz”, select the “Open it with” radio box and browse to the amazonmp3 script. I personally checked the “Always ask me” box but YMMV.
  • Use the OK buttons to get back out.

At this point, when you download an AMZ file FireFox should automatically run the script with the downloaded file as an argument, and your download will proceed.

Other Tips

Beware that you are only allowed to download once, and Amazon is not required to make it right if your download screws up somehow and you don’t get your music. I had something wrong happen on a single-song download and Amazon did fix it for me, but there are no guarantees. I urge you to get everything working with the free song download they’ll provide first, before you trust it to downloads you paid for.

The downloader seems to always put music in the “~/Amazon MP3” directory. I like my music in the ~/Music directory, so I created a symbolic link:

    cd ~
    ln -s Music 'Amazon MP3'

(Don’t forget to quote the whitespace). Now everything goes to the right spot automatically.

If your download does die in the middle, try restarting the download manager. If you want to to it with my script, pass a dash (“-“) as the argument instead of a filename, and it’ll just start the download manager with no arguments. Most likely it will pick up where it left off.

If you have a copy of CodeWeaver’s Crossover Linux, which is a very nice productized version of Wine, I still recommend downloading the Ubuntu version of Wine and using that for the Amazon MP3 Download Manager. I tried one time to use Crossover and while it seemed to work my download got stuck 72% in and wouldn’t continue. I only tried it that one time so it may have been some other glitch. But, FYI.

References / Thanks

On this thread in the Ubuntu User Forums, specvthis mentioned how to run the download manager in wine with an AMZ file as an argument to get it to work. In that same thread I found jomofo7‘s announcement of his guide which I reference above.

Thanks to them, and of course the most thanks to the Wine developers without whose hard work none of this would be possible!

Leave a Reply

Your email address will not be published. Required fields are marked *