PDA

View Full Version : Where can I find information on parsing the iTunes Library?




KelchM
Jan 24, 2009, 10:11 PM
Hey guys.

I'm currently toying with the idea of a new project that would allow me to take the lossless itunes library on my desktop, transcode the music into a lossy format and then copy it to a laptop.

This would also allow me to have a copy of my entire music library, albeit at lower quality. Ideally I'll also be able to maintain the same podcasts subscriptions on both systems.

Another benefit of this would be that I could sync my iPhone to this lossy library. This is appealing as it makes little sense to me to carry lossless audio on a dap.

To get started I just want to learn how to work with the iTunes library. Anyone know of any resources I can use to get started?



kainjow
Jan 25, 2009, 09:07 AM
iTunes stores a copy of its database in a normal property list format, so if you're using Cocoa it'd be easy to read. Just open the "iTunes Music Library.xml" file in Property List Editor to see how it's organized.

hhas
Jan 25, 2009, 10:39 AM
iTunes stores a copy of its database in a normal property list format, so if you're using Cocoa it'd be easy to read. Just open the "iTunes Music Library.xml" file in Property List Editor to see how it's organized.

Assuming the OP's using Cocoa, I believe the iMedia framework (http://code.google.com/p/imedia/) knows how to read the "iTunes Music Library.xml" file.

There's also iTunes' Apple event ("AppleScript") interface, of course, though if read-only access is all that's needed then the XML file is probably the cleaner option.