Archive for the 'Resources' Category

Automate Artist Image Downloads
February 21st, 2007

Cover Art downloaders that utilise Amazon or another large online shop’s database of images are fairly well know and there’s a number of them to choose from. Artist images however are not so easy to come by. With Hydrogen Audio member Chronial’s help I set about creating a web based service that anyone can use as simply as possible to grab any artist’s picture and place it anywhere… whether it be through batch file downloading, foobar or elsewhere on the web.

The result is the aptly titled “Artist Images” site, located at http://artists.trivialbeing.org.

http://artists.trivialbeing.org/?a=ARTIST NAME
This page displays the artists thumbnail image and some information on how to use it, check out http://artists.trivialbeing.org/?a=blondie for instance. Maybe you want a bigger image, thumbnails too small? Simply append the URL with &imgs=large, for example http://artists.trivialbeing.org/?a=blondie&imgs=large.

This is all well and good for browsing but what’s the URL for including artist images either in a URLdownloader script or to include on forums etc.?

For a thumbnail, http://artists.trivialbeing.org/pic/blondie.jpg
For a full size image, http://artists.trivialbeing.org/bigpic/blondie.jpg

Blondie

This URL will always return an image, if the file is not in the cache it will locate it, download it and still show you. Only a few results will return a “no artist” image result.

Now, the exciting bit. How do you integrate this into Foobar2000? Up until now I have been recommending URL2File, a command line downloading application that you need to first install and then script. There is now a better more succinct way using AutoHotKey. You can install this and run a .ahk if you want, or you can download a standalone compiled executable (i.e. I have done the work for you).

Download Download Large Artist Images .exe
Download Download Thumbnail Images .exe

The AHK code contained within is simply:

#NoTrayIcon
SetWorkingDir, %A_ScriptDir%
UrlDownloadToFile, http://artists.trivialbeing.org/bigpic/%1%.jpg, %1%.jpg
exit

Place these in any directory you want and pass the artist name as an input parameter to them. The file will be downloaded as a .jpg file to the folder that the executable is in.

e.g. running C:\artistimagethumb.exe “blondie” via the command line will download blondie.jpg and save it in the root C:\ directory.

To integrate this into foobar you will need Foo_Run. Under the Run Services option add a new service, call it what you like, make sure the path to the executable is correct. Now you need to add the parameter, e.g.:

“C:\artistimagebig.exe” $replace($replace(%artist%, ,+),&,and)

This passes the selected artist to the executable to be downloaded. If “system of a down” is selected it will be changed to “system+of+a+down”, all & characters will be replaced with “and”. Please note: \ / : * ? ” < > | are all characters that cannot be used in file naming, as a result any artists containing these characters will be upset to find out they won’t be getting a profile pic.

Now assign this to a keyboard shortcut and you’re there.