Automatic album art downloader
2007-11-11 22:05:47
Hi all, I made myself a small tool to help getting album art. I use Google Images, but it could use other sources, too. The idea is that with a single hotkey in foobar2000, the tool downloads cover art to a specific location so that it can immediately be seen with an album art plugin. I'm quite happy with it, so thought it could be usable for others, too. I guess this is more about the concept, but here are steps to get it work using my way. It uses VBS script for launching, wget for getting the image and a web server script to locate and return images from Google. You'll need foo_run plugin, and I'm using the Columns UI's album art viewer. Download http://ztesch.fi/albumart/albumart.zip , extract to the foobar2000 folder. Set up a Run Services script called e.g. Run/CoverGetter. The code should be, for examplecovers.vbs "%artist%" "%album%" "X:\path\covers\%artist% - %album%" 0 500 You should modify the file/path name of the covers. I'm using my own style, and I'm sure this could be used to save cover.jpg images, too, so that the Default UI can easily locate the images. Value 500 means the maximum resolution of images. If the image is smaller, nothing will be done, and if it's greater, it will be resampled to a width of 500 pixels. Use what you like, or -1 to disable resizing altogether. Value 0 means that the cover will be fetched from cache, and if no cache exists, it takes the best match from Google Images. Alternative values are 1..n. In this case, the cover art will always be re-fetched from Google Images, and the number denotes which match will be taken - first, second, third, and so on. This is needed, because every now and then an invalid image is returned. The script at the web server currently ranks images according to the width/height ratio (covers are probably close to 1) and size (bigger images are usually better). So, you'll probably want to create the following commands to Run Services:Run/CoverGetter: covers.vbs "%artist%" "%album%" "X:\path\covers\%artist% - %album%" 0 500 Run/CoverGetter 1: covers.vbs "%artist%" "%album%" "X:\path\covers\%artist% - %album%" 1 500 Run/CoverGetter 2: covers.vbs "%artist%" "%album%" "X:\path\covers\%artist% - %album%" 2 500 ... Run/CoverGetter 9: covers.vbs "%artist%" "%album%" "X:\path\covers\%artist% - %album%" 9 500 Then, create shortcuts to each of them. I use ctrl+§ for the first one (Finnish keyboard), ctrl+1, ctrl+2 .. ctrl+9 for the later re-fetching commands. And finally, make sure the album art plugin is looking at the right place for the covers. I use one directory to hold all of them. After this, all should work fine. So, this can be used directly, or you could create your own web service to get Google images, shouldn't be too hard. Of course, comments are welcome if there are any problems.