tags:

views:

302

answers:

3

We want to write a Windows/OS X app that sends podcast ratings info from an iPod and iTunes back to a server. Two questions: (1) Is there documentation for how ratings data are stored in iTunes, and (2) if a user has iTunes set to auto-delete programs he has heard, is there a way to capture the ratings data before it's gone?

+1  A: 

itunes stores its Music Library data and Ratings in an XML file on the user's machine. In windows its located in the "Music" or "My Music" folder.

You can open the "iTunes Music Library.xml" file and look for the Rating element to see what the user rated each song. Since its XML, it's pretty self-explanatory. That should be pretty easy to open and parse from the program you're writing.

I think iTunes doesn't remove the podcasts from its xml file until the program is closed. You should be able to grab that rating data as long as itunes is still open.

Varin
+1  A: 

I doubt there is an official spec on the data file format, but you can find rating info in the "iTunes Music Library.xml" file in the iTunes directory. Look for a key called "Rating" with an integer value from 0 to 100. It won't be there if the user hasn't rated the item. For example, a 4-star rating will have a value of 80.

Marc Novakowski
+1  A: 

In addition to the xml file, there is also a COM interface that will give you access to all of the library info, including the rating for each song. The SDK is documented.

I don't know what language you want to use, but I have used the C# to interface with iTunes and it was very smooth.

You can download the SDK at http://developer.apple.com/sdk/

epotter