Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access to iTunes Ratings Data

Tags:

itunes

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,
  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?
like image 214
Doug Kaye Avatar asked Dec 04 '25 08:12

Doug Kaye


2 Answers

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.

like image 179
Marc Novakowski Avatar answered Dec 11 '25 03:12

Marc Novakowski


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.

like image 33
Daniel Delaney Avatar answered Dec 11 '25 01:12

Daniel Delaney



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!