Artist Image Downloader, Service, Script etc.
Wednesday, January 10, 2007
A big feature I wanted to include in my foobar2000 music player was artist images, i.e. pictures of the performers. If I had the images this would be possible using either the track info mod (which I now favour) or the album art panel. The trouble was, unlike album art, there was no service that offered image downloads and the only website that offered a comprehensive artist image database was last.fm. My first approach to this problem was to create a local C script that would, in a very roundabout manner, obtain the artist image url from last.fm and then download it. This proved rather slow and buggy due to various artist names, timeout problems and image creation, yet it sufficed for the majority, leading me to a collection of 2000 artist images which I posted earlier.

Still not happy, I looked into creating a web service, based on hydrogenaudio forums member Chronial's efforts and ultimately we developed an online resource for downloading artist images. I do not plan to make the code public, mainly at Chronial's request. I have created this service here: http://artists.trivialbeing.org/?a=ARTIST where ARTIST is the performer's image you are looking for, for instance:

http://artists.trivialbeing.org/?a=the microphones
http://artists.trivialbeing.org/?a=blondie
http://artists.trivialbeing.org/?a=radiohead

Images are first sourced from Last.fm before being cached so as not to cause any undue strain on last.fm's servers.

To make things more useful you can append the URL with &outputmode=img,
e.g. http://artists.trivialbeing.org/?a=blondie&outputmode=img
and a wrapper of sorts is available via http://artists.trivialbeing.org/pic/ARTIST.jpg
e.g. http://artists.trivialbeing.org/pic/blondie.jpg
which can be used on forums:
http://artists.trivialbeing.org/index.php?a=blondie&outputmode=img

or in an artist download script. I use the URL2File command line application with this command:

URL2File http://artists.trivialbeing.org/pic/%1.jpg  C:\artistimages\thumbnails\%1.jpg -o 60
Where %1 is the first parameter passed to the batch file and 60 is a one minute timeout.

Using a custom run component I can call this batch file using foobar and a keyboard shortcut or button; when passing the artist (%artist%) to the batch file you should take care to replace characters that cannot be used in creating windows filenames. Foreign characters work too, as do special characters such as the artist "Why?" or "Wham!".

When using image output, if no artist is found the script returns this image:
The image

With regards to copyright issues, Last.fm's uploading policy states:
Because copyrighted images tend to be very restrictive about where they can be used we ask that you only upload images which are public domain, or that are explicitly licensed for promotional use. There are a number of places you can find images open to public use. First, try to find out if the artist has any promotional pictures on their official homepage (they usually do).

For those without foobar2000, I give an example of an alternative use. I took the recently played tracks RSS feed, played with it a little using magpierss and create a page that shows recent tracks along side artist images, an example can be found here:
http://fofr.trivialbeing.net/page.php?p=nowplaying

Labels: , ,

Posted by FofR | Permalink | Comments (2) |
2 Comments:

By Blogger zero(Kurt), at July 08, 2007  

Hey there, I was curious, how can I get this to work. I was thinking the same thing, but I don't have the coding knowhow to make something to retreive images and whatnot... I see that script you have there for getting the images... but how do I make foobar look for those. I've been trying to get it to seek the images off the server but i guess the images have to be local? Then I thought maybe since the lastFM client shows the artist image as you play a track maybe they'd be in cache but I couldn't find where they might be if they are stored.

Any advice/help?

By Anonymous Anonymous, at August 19, 2007  

Where I can download this script? It would be very useful.

Post a Comment