Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A better way to get cover art into iTunes database UNIX
A previous hint suggested a way to add your own artwork to iTunes' art database, so it's not stored inside each individual track. However, it didn't seem to work all of the time.

So I wrote some Python scripts to do this. They intercept iTunes' requests for cover art, and allow you to send your own images. They're sent back to iTunes in the same format that the iTMS sends them, so they work just as well. The script includes a basic browser-based interface for selecting images for each album. You can enter your own URLs, or search Amazon for covers.

You'll need to have Python 2.4.3 installed, and not be afraid to edit your hosts file. If you want to search Amazon, you'll also need to sign up for a free Amazon Web Services account. Download the scripts (40KB) (MacOSXHints mirror), and you'll find the instructions in the included README.txt file.

[robg adds: I haven't tested this one yet, and note that you'll have to disable your local webserver in order for this to work, as well as modify the hosts file.]
    •    
  • Currently 3.50 / 5
  You rated: 4 / 5 (6 votes cast)
 
[64,144 views]  

A better way to get cover art into iTunes database | 32 comments | Create New Account
Click here to return to the 'A better way to get cover art into iTunes database' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A better way to get cover art into iTunes database
Authored by: damiond on Oct 10, '06 11:59:36PM

Just this afternoon I had another play to try and make iTunes add my own artwork to its database instead of the individual files, and then I browse here and see this hint!

Worked great for me - Although i have python43 installed via darwinports, so I had to alter the first line of the coverArtServer.py script to point to the correct location.
I couldn't get the local file method working though either: tried both file:///Users/blah/file.jpg and /Users/blah/file.jpg

But pasting URLs from the web works fine.



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: mrgibbysworth on Oct 11, '06 07:51:39AM

I don't mind the auto-fetching of cover art, but I also listen to my tracks on other non-iTunes devices (XBMC via SMB) which can't access the album art from the iTunes DB.

Has anyone a solution for embedding the fetched art from the DB into the files (ala the "old" way, via tags) in an automated way?

Other suggestions welcome...

PS I'm still looking for an elegant solution for mutiple users each with their own iTunes library, utilizing a single shared folder full of music files.



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: kmue on Oct 13, '06 12:14:19AM

Great little app! What about integrating fetching of cover art from itunes store and allmusic.com?



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: nick_harambee on Mar 23, '07 04:47:34PM

my frustration with this method, which is a useful workaround, is that i can only have one album art image per album, when i would like to have several for many of my albums. it would seem that if you want multiple images, then embedding art is the only way to go, which means much larger filesizes and impossibly large files for the ipod.

nick



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: nick_harambee on Mar 31, '07 06:00:17PM

does anyone know why local artwork added to the iTunes Album Artwork folder using this method works with Coverflow, but not with the Cover Version visualisation, which does work with Album Artwork downloaded from the iTunes store? both methods save artwork as ITC files, but only the iTunes store and embedded artwork work with Cover Version

thanks

nick



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: mogloo on Apr 02, '07 01:20:13PM

After spending all afternoon trying to figure out how to do this by (unsuccessfully) reverse engineering .itc files, I found this hint. It works well and doesn't touch your .mp3 files.



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: 8unknown on Apr 29, '07 07:49:44AM

I have been looking for a while for something like that as well... after a few tries it worked great (but it's a slow process... I wish there was an iTunes plug-in or applescript to do that...)

My problem is that now when I clear everything...

"When you're done:
In Terminal, press control-C to stop the server.
Delete the lines from /etc/hosts.
In Terminal, type "lookupd -flushcache" again."

...the "Get album artwork" in itunes doesn't work anymore... I reinstalled itunes, checked everything... but it still doesn't work anymore
I can see "Processing album artwork" for 1 sec and then nothing...

I think the method below messed up with the iTunes settings (phobos.apple.com...sthg like that)

Any suggestions ??
Oh and if you know another way/a new app that can get artwork into itunes Album artwork folder instead of embedding it, let me know !

Thxxxx



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: 8unknown on Apr 29, '07 07:52:58AM

I have been looking for a while for something like that as well... after a few tries it worked great (but it's a slow process... I wish there was an iTunes plug-in or applescript to do that...)

My problem is that now when I clear everything...

"When you're done:
In Terminal, press control-C to stop the server.
Delete the lines from /etc/hosts.
In Terminal, type "lookupd -flushcache" again."

...the "Get album artwork" in itunes doesn't work anymore... I reinstalled itunes, checked everything... but it still doesn't work anymore
I can see "Processing album artwork" for 1 sec and then nothing...

I think the method below messed up with the iTunes settings (phobos.apple.com...sthg like that)

Any suggestions ??
Oh and if you know another way/a new app that can get artwork into itunes Album artwork folder instead of embedding it, let me know !

Thxxxx



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: nick_harambee on Sep 12, '07 02:06:03AM

this no longer seems to work with iTunes 7.4. anyone got any ideas how to get it to work?

thanks

nick



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: Johnny_B on Oct 05, '07 04:36:57AM

Works great in 7.3. I revered my library back to 7.3, but alot of thing have happend since that time in my library so it is out of the question to downgrade.

Somebody know what's wrong?



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: spl23 on Nov 01, '07 09:39:06AM

Since discovering this tip, I've been maintaining my iTunes library in 7.3, and importing to 7.4 every time I need to update my iPod. I got bored with this...

I spent an hour with a packet sniffer the other day, and managed to update the Python script to work with iTunes 7.4. I've sent a copy of my new version to Jacob (the original author) - hopefully he can amend the published version. I don't feel comfortable about simply releasing my new version, as I'm not the original author.

But if anyone out there knows Python and would like to hack their own script, there are two main changes. You need to add a response to the initiateSession command (just send the XML captured from a packet sniffer) and the search command sent by iTunes has changed very slightly - the response sent by the Python script is identical.



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: jweber on Nov 04, '07 03:55:17PM
I've incorporated the changes that spl23 sent me, and the new version is on the site:

http://www.jacobweber.com/scripts/coverArt1.1.tar

Note that it will no longer work with iTunes 7.3; you should continue to use the current version for that. Also, please read the README.txt file again, as it has changed somewhat.


[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: spl23 on Nov 07, '07 01:03:50PM

And just to bring things right up to date, the version for iTunes 7.4 works just fine with the new iTunes 7.5 as well. In fact, the library files don't even change between 7.4 and 7.5, unlike changing from 7.3 to 7.4.



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: shadinger on Nov 11, '07 12:04:07AM

Hi,

This was exactly the tool I was looking for. Inserting external covers directly into iTune is for more effective than trying to add images to mp3s.

I know this is a MacOS site, but I wanted to inform that it also works perfectly on Windows XP - using Python on cygwin.

You need to change the file "c:\{windows}\system32\drivers\etc\hosts". It does not seem necessary to flush the dns. If you need : "ipconfig /flushdns".

Great work!



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: jweber on Nov 16, '07 04:27:26PM

Thanks! Glad to know it works in Windows too. I'll note that in the documentation.



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: teridon on Dec 16, '07 01:33:37PM

Just a note: you don't have to use the cygwin version of python - the native Windows version of python works as well.



[ Reply to This | # ]
What if I don't have an iTunes account?
Authored by: gustavo.michels on Nov 24, '07 07:30:58AM

My country doesn't have an iTunes Store, so that's why I need a cover art fetcher. I don't want one that embeds the art to the mp3 (there are gazillions of those available), and so far, this is the only way I found to add the covers to the database.

However, for obvious reasons, I don't have an iTunes store account. Any ways to bypass the check? Or maybe create a 'fake account' on the localhost webserver?

Thanks



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: speedy_2 on Jan 07, '08 09:57:33PM

Thanks a lot for your great tool!

One thing though, that does not work: If you buy music at the iTunes store and Apple gave you the wrong cover (it happens), it is not possible to set a new cover with this tool. iTunes returns an error 500 and in the coverartserver window you see that an exception occured. Does anyone know how to make this work?

Norman



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: spl23 on Jan 18, '08 02:24:25AM

Just tested this with iTunes 7.6. There seems to be a small change in the protocol between your machine and the ITMS - when you run the cover art server and ask iTunes to get artwork, iTunes shows an error message telling you that a secure connection to the server could not be established, and asks if you still want to continue. If you do continue, everything seems to work as before - presumably iTunes is now doing some form of authentication to do with movie rentals, and I'd guess that will not be easy to replicate locally, so for now, you just have to ignore the warning message and carry on.

Should Apple ever enforce this secure connection for all transfers, this very useful little program is likely to break permanently...



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: spl23 on Jul 10, '08 03:51:23AM

Just to keep this up to date - I've just downloaded iTunes 7.7, and I'm sorry to report that it has broken CoverArtServer again. Presumably the protocol has been changed - CAS sees a request from iTunes, but it either doesn't know how to respond, or the response isn't what iTunes is expecting any more.

If I get bored, I'll install the packet sniffer and see if I can see a fix, but for now, if you want to use CAS, stick with iTunes 7.6.



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: spl23 on Jul 10, '08 03:52:28AM

Just to keep this up to date - I've just downloaded iTunes 7.7, and I'm sorry to report that it has broken CoverArtServer again. Presumably the protocol has been changed - CAS sees a request from iTunes, but it either doesn't know how to respond, or the response isn't what iTunes is expecting any more.

If I get bored, I'll install the packet sniffer and see if I can see a fix, but for now, if you want to use CAS, stick with iTunes 7.6.



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: spl23 on Sep 10, '08 04:14:36AM

And in case anyone is still listening...

I managed to hack coverArtServer to work with iTunes 7.7.

The bad news is that iTunes 8 seems to have changed the protocol significantly - I've been peering at packet logs, and I am at a loss how to fix it this time. Someone cleverer than me might want to have a look, but this looks really broken now... ;-(



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: spl23 on Sep 10, '08 05:32:16AM

Still more detail...all bad news, I fear.

The cover art process seems to have changed a lot with iTunes 8. Cover art is now delivered from the store in a file with an ITC2 extension rather than an ITC extension. ITC files were just JPEGs with a header, but the JPEG data in an ITC2 file is encrypted - if you strip the header, the resulting JPEG is the right size but is full of garbage.

The query process for getting artwork from the store has gone to another level of complexity - the query is sent to one address, the response identifies a file, and this is downloaded from a different address. There also seems to be a crypto key associated with the request for artwork, although I guess that this could be ignored on a local server (unless the key is what is used to encrypt the JPEG data).

The iTunes library file is still encrypted and no-one knows the format, so that isn't a sensible approach for hacking. I've tried substituting different JPEG data into an ITC2 file, but iTunes just deletes the file as corrupt.

It would seem that iTunes 8 means that the only way to get artwork into the database is to download it properly from the ITMS, which means we are back to being at the mercy of Apple with low quality, poorly-formatted, wrong or absent covers. Not a step forward - I think I shall be sticking with my 160GB iPod classic for the forseeable future.



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: jweber on Sep 13, '08 09:52:55PM
I've updated the script for iTunes 8:
http://www.jacobweber.com/scripts/coverArt1.3.tar


[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: jweber on Sep 13, '08 09:53:50PM
I've updated the script for iTunes 8:
http://www.jacobweber.com/scripts/coverArt1.3.tar

[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: sc300 on Sep 14, '08 10:35:30AM
Not getting anything over here.

-Windows
-iTunes 8
-Python 2.5.2
-CAS 1.3

I've got:

127.0.0.1 ax.phobos.apple.com.edgesuite.net
127.0.0.1 a1.phobos.apple.com
127.0.0.1 phobos.apple.com

in my hosts.

iTMS will either not load or load with broken links on images, run get album art, and I'm getting nothing but blank Album List panes on http://localhost:9999.

What am I missing?

[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: sc300 on Sep 14, '08 10:55:10AM

I guess I can start with the duh, where the README says it's no longer required to edit the hosts file.



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: sc300 on Sep 14, '08 11:18:16AM

Alright windows users, just in case you get hung up like I did here's what I did.

Windows/iTunes 8
1. Get python 2.5.2 (msi installer works fine)
2. Got to IE, open Internet Options, Connections tab
3. LAN settings, check Use Proxy Server
4. Punch in Localhost, 9988, click OK.

BAM!



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: dr9553 on Sep 16, '08 09:30:11AM

Oh how i wish this would work with TV shows i have encoded that are on the ITMS, but it doesnt appear that itunes actually calls out to the store to look for video artwork :(. I love being able to store the artwork not in each file.



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: spl23 on Sep 24, '08 03:30:29AM

If you are running this on a PC, it is not easy to leave the proxy server running in the background all the time, and bear in mind that if you have the proxy setting in IE turned on, other things on your PC may not work properly.

For example, I discovered that with the localhost proxy enabled, the desktop Sonos Controller application can't get cover art from my NAS, although it works in all other respects. Took me a while to work out what was going on there!

IE will store the proxy settings for you even if they aren't enabled, so the best thing to do is to turn the proxy off whenever you aren't actually running the Python program.



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: speedy_2 on Nov 21, '08 05:30:24PM

Hi

In iTunes 8.02 the server from which iTunes gets the album art has changed from

"ax.phobos.apple.com.edgesuite.net"
to
"ax.itunes.apple.com"

If you correct line 197 in coverArtServer.py everything works fine again.
Not sure what the setting in 8.01 was. The last time I used CoverArtServer I still had 7.6.

Norman



[ Reply to This | # ]
A better way to get cover art into iTunes database
Authored by: zenarcher on Sep 15, '09 10:07:05AM

The iTunes 9/Snow Leopard combo seems to have broken this. Anyone know what changes need to be made to get it going again?



[ Reply to This | # ]