Access to iTunes Music Store (iTMS) from Linux

Apple, Inc. seems to be moving at a glacial pace away from DRM (Digital Restrictions Management) on AAC sound files offered at the iTunes Music Store -- but DRM remains a factor, for now. Following are Linux options to deal with iTMS access, and to deal (or not deal) with the DRM. All codebases mentioned other than iTunes for MS-Windows and CrossOver Linux are open source.

(This page deliberately eschews links to lamers attempting to petition Apple, Inc. to release proprietary iTunes software for Linux and/or BSD.)





JHymn, MyFairTunes6, QTFairUse6, and FFH
JHhymn (Hear Your Music aNywhere, implemented in Java) on Linux stripped the Veridisc FairPlay encryption present on most iTMS AAC files (.m4p = encrypted AAC) you purchase from iTMS, turned them into regular AAC (.m4a) files, which then could be played on Linux without using iTunes for Windows on Linux (e.g., under WINE) to get to them. It was compatible with sound files downloaded by pre-6.0 versions of iTunes. However (note Wikipedia link, below), it is currently (2008-01) necessary to instead use similar open-source programs MyFairTunes6 or QTFairUse6 on MS-Windows, or FFH (Flaky Fairplay Hack) on Mac OS X, instead of JHymn, to perform the encryption-stripping, as those alone are compatible with recent (e.g., 7.5.0) iTunes versions that are now required by iTMS.
http://hymn-project.org/jhymndoc/ (JHymn, currently non-useful a/o 2008-01)
http://hymn-project.org/forums/viewtopic.php?t=1314 (FAQ)
http://en.wikipedia.org/wiki/Hymn_(software) (HYMN project nature and history)
http://www.hymn-project.org/download.php (MyFairTunes6, QTFairUse6)
http://hymn-project.org/forums/viewtopic.php?t=2436 and, in particular, http://hymn-project.org/forums/viewtopic.php?p=16655#16655 (FFH)





CPAN M4P and iTMS_Client modules
Perl's CPAN repository includes William Herrera's Perl package Audio::M4P (encompassing Perl modules Audio::M4P::Atom, Audio::M4P::Decrypt, and Audio::M4P::QuickTime), which when used in conjunction with Herrera's LWP::UserAgent::iTMS_Client allows one to access iTMS, download your keys, purchase Veridisc FairPlay-encrypted AAC files (.m4p = encrypted AAC), and then strip them to regular AAC (.m4a) files.
http://search.cpan.org/~billh/LWP-UserAgent-iTMS_Client-0.16/lib/LWP/UserAgent/iTMS_Client.pm (iTMS_Client)
http://search.cpan.org/~billh/Audio-M4P-0.42/ (Perl atoms for dealing with M4P/MP4/M4A QuickTime audio and video files, a library for decryption of Veridisc FairPlay encryption present on most iTMS AAC files, Perl M4P/MP4/M4a audio / video tools, and documentation)
http://search.cpan.org/~billh/ (Check this page for newer releases.)





iTunes on WINE
WINE 0.9.45 or newer (on x86 Linux) can run iTunes 7.3 for MS-Windows. This of course leaves the Veridisc FairPlay encryption present on most iTMS AAC files (.m4p = encrypted AAC) intact, but the iTunes app can play the sound files within Apple's DRM control regime. (Set WINE to emulate MS-Windows XP, using winecfg.) Also, iTunes 7.4.3 for MS-Windows is verified to work fully under WINE 0.9.51. Note: CrossOver Linux (in place of WINE) a/o v. 6.2.0 does not allow iTunes to access iTMS, though it does access Apple iPods.

Note one dire disadvantage of using iTunes (on any OS) to manage Apple iPods: It considers each iPod tied to iTunes's (undocumented, proprietary) "library" (set of downloaded sound files, or iTunesDB, which gets maintained in both the iTunes application's own files and on the iPod if any), and therefore will wipe out any sound files installed into the iPod by other means (absent measures to also add a record of the sound files into the iTunes library, overcoming Apple's occasional changes to library file formats such as adding SHA1 hashes aka checksums in late 2007, and causing iTunes to report that the iPod has zero tracks if the checksums don't match -- which feature was reverse-engineered two days later, but that sort of thing can happen again). Sticking to iTunes-alternative applications (below) to manage one's iPods eliminates this entire class of problem.
http://wine-review.blogspot.com/2007/10/itunes-73-on-linux-with-wine.html (running the iTunes app on WINE)
http://www.boingboing.net/2007/09/14/new-ipods-reengineer.html (SHA1 hashing added to iTunesDB)
http://www.codeweavers.com/compatibility/browse/name/?app_id=974 (CrossOver Linux's iPod support)
http://amarok.kde.org/blog/archives/496-iPod-Classic-Will-Be-Supported.html (Amarok developer reverse-engineers iTunesDB hashing)





Banshee iTMS plugin
Banshee music player supports an unofficial iTunes plug-in that allows it to interact with iTMS the same way the iTunes application does. However, this approach (1) involves running unsupported, unmaintained developer plugin code that may not work at all, and (2) leaves the Veridisc FairPlay encryption present on most iTMS AAC files (.m4p = encrypted AAC) intact.
http://www.banshee-project.org/Plugins




SharpMusique
SharpMusique by Jon Lech Johansen (in C#), based on PyMusique (in Python) by Travis Watkins, Jon Lech Johansen, and Cody Brocious, let Linux users buy AAC files from iTMS, and on-the-fly strips the Veridisc FairPlay encryption present on most iTMS AAC files (.m4p = encrypted AAC). However, it ceased to be maintained after v. 1.0 in Sept. 2005, and changes at iTMS broke it in mid-2006.
http://nanocr.eu/2005/09/17/sharpmusique-10/ (thread with download links)
http://www.forbes.com/2005/03/28/cx_ah_0328tentech.html (story)
http://en.wikipedia.org/wiki/SharpMusique (SharpMusique explanation)
http://www.engadget.com/2005/03/29/pymusique-creator-says-it-was-all-about-getting-linux-for/ (article explaining PyMusique's context)





Related Topics:




iPod Access:




This file does not specifically aim to cover Linux access to Apple iPods (the other major use of the iTunes application[1]), but here are six Linux apps that do that well:

Comparison of the above: http://techlogg.com/content/view/371/40/

Others:





Streaming Servers for iTunes and compatible clients, using Digital Audio Access Protocol (DAAP):

(1) Firefly, formerly mt-daapd, is an open source digital audio server that can stream your sound library to iTunes. (2) daapd scans a directory for sound files (mp3, aac, uncompressed) and makes them available via the Apple proprietary protocol DAAP. DAAP clients can browse the directory and retrieve individual files, either by streaming or by downloading them. (3) Get It Together (GIT) is a Java DAAP client/server backed up by an XML-based sound library and the ability to access songs from iTunes/iPod sound libraries. Based off of AppleRecords and One2OhMyGod. (4) Tangerine is an application that allows you to publish sound files over the local network, using DAAP. It runs on Linux, Windows, and Mac OS X.
http://www.fireflymediaserver.org/ (Firefly Media Server)
http://sourceforge.net/projects/mt-daapd (Firefly devel. site)
http://www.deleet.de/projekte/daap/ (daapd)
http://getittogether.sourceforge.net/ (Get It Together)
http://www.snorp.net/log/tangerine/ (Tangerine)
http://www.macosxhints.com/article.php?story=20030711140157143 (Firefly article)

It's important to note that Apple regards DAAP and RAOP (Remote Audio Output Protocol, used for streaming) as non-documented, proprietary protocols and occasionally subjects them to imcompatible changes without notice. Third-party support is made possible only through outside reverse-engineering, which must be repeated at intervals when Apple introduces new obstacles. E.g., at the moment (2008-01), non-Apple RAOP clients (Rhythmbox, etc.) cannot successfully receive AV streams from Apple iTunes (7.x) itself via Apple Airport Express WAPs (which Apple calls "AirTunes"), hence nobody has been able to implement independent RAOP-serving Wireless Access Points (WAPs) that iTunes will be willing to stream to, because of new RAOP-functions cryptographic wrapping introduced with iTunes 7.x. Likewise, non-iTunes implementations of DAAP currently cannot exchange audio files with iTunes, for similar reasons.
http://0pointer.de/blog/projects/apple-sucks.html (Apple lock-in introduced with iTunes 7.x)
http://amarok.kde.org/blog/archives/499-more-on-Apple.html (Amarok developer's similar account)





Replace Apple's Firmware on Your iPod with Something Better

"Rockbox is open source firmware for mp3 players, written from scratch. Rockbox aims to be considerably more functional and efficient than your device's stock firmware while remaining easy to use and customizable. [...]" (You can also dual-boot iPods with both Rockbox and the original firmware.)
http://www.rockbox.org/




[1] The Apple iTunes application is a:




Extra Credit Essay:

"When Pigs Fly: The Death of Oink, the Birth of Dissent, and a Brief History of Record Industry Suicide", http://www.demonbaby.com/blog/2007/10/when-pigs-fly-death-of-oink-birth-of.html. (Like him or hate him, Rob "demonbaby" Sheridan is telling the truth.)