Buying Music From iTMS in Linux

On saturday, I spent a little time trying to work out how to give Steve Jobs my money; more accurately, I wanted to get some way to buy music from the iTunes Music Store from my Linux desktop, and this isn’t as easy as it really should be, because the official iTMS is a mess of proprietary Mac- and Windows-only DRM-laden badness.

Here’s a quick walkthrough of how this went:

  • install iTunes in my VMWare Windows install
  • sign up for iTMS, and give Apple all my personal info, including super-s3kr1t card verification codes, eek
  • buy a song
  • find the DRM’d file in the filesystem; it’s an .m4p file, and xine doesn’t seem to like it
  • do some googling for ‘iTunes DRM remove linux’; that leads to Jon Lech Johansen’s JusteTune
  • download and run JusteTune installer
  • get obscure hexadecimal error code dialog. hmm! what could that mean?
  • download and run .NET runtime, link on JusteTune page
  • rerun JusteTune — it works this time
  • select Account -> Authorize, enter login info
  • drag and drop file — it’s decrypted!

So, that yields a decrypted AAC file, which I can play on Linux using xine. That’s the hard part done!

However, I want to play my purchases in JuK, the very nice iTunes-style music player app for KDE.

While the gstreamer audio framework supports playback of AAC files with the gstreamer0.8-faad package (‘sudo apt-get install gstreamer0.8-faad’), JuK itself can’t find the file or read its metadata, so it doesn’t show up in the music collection as playable. I don’t want to go hacking code from CVS into my desktop’s music player — possibly the most essential app on the desktop — so transcoding them to MP3 seems to be the best option.

Somebody’s already been here before, though — that’s one of the benefits of being a late adopter! Here’s a script to convert .m4a files to .mp3 using the ‘faad’ tool (‘sudo apt-get install faad’).

During this work, I came across Jon Lech Johansen’s latest masterwork — SharpMusique, a fully operational native Linux interface to the iTMS. Building on Ubuntu Hoary was a simple matter of tar xvfz, configure, make, sudo make install, and it works great — and automatically de-DRMs the files on the fly as it downloads them! Now that’s the way to enjoy the iTMS on Linux, at least until Apple’s engineers break it again.

Update, May 2006: Apple’s engineers broke it. Thanks Wilfredo ;)

End result: a brand new, complete, high-quality copy of Dengue Fever’s new album, Escape From Dragon House. Previously I’d only had a couple of tracks off this, so I’m now a happy camper, music-wise.

BTW, I was also considering trying out the new Yahoo! Music Store, but it too uses fascist DRM tricks and is platform-limited, and I’m not sure how breakable it is. On top of that, the prospect of not being able to try it out before handing over credit-card details put me off. As far as I can see, I can’t even look up the albums offered before subscribing. All combined, I’ll stick with iTMS for now.

This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink. Both comments and trackbacks are currently closed.


  1. Posted October 30, 2005 at 00:07 | Permalink

    I’m not sure how breakable it is.

    I’m sure how breakable it is, but I’m not sure if anyone’s posted instructions yet.


  2. Posted October 27, 2006 at 12:25 | Permalink

    You have vmware. Vmware can play music on linux. That means writing to /dev/dsp (configurable in vmware setup.) There may be a way to read from /dev/dsp, as it is written but I don’t know it. That doesn’t matter. All you need to do is make a fifo, with mkfifo called /dev/snoopdsp (or anything else) and configure VMware to use it instead of /dev/dsp. Then make a small program/script that slurps these bytes up and writes them somewhere else- you could even detect silence between tracks and make a new file each time. Then convert this audio from pcm format to mp3 and you are good to go. DRM is silly. You could even have this program forward the info to /dev/dsp as well so you can still hear it.

    Of course, you wouldn’t even need a program to listen to a fifo if you just wrote directly to one big file, but then you couldn’t hear it as you go.

    For extra credit- it may be possible to insert some timing hacks into the guest windows OS so that it decodes faster than realtime.