DisCoverArt: Batch import album cover art based on artist and title

DisCoverArt 2.10.0.1 (Freeware tool used in conjunction with mp3tag)
Get albumart/coverart for music based on artist and title or album
You can download it here: http://bit.ly/3aT8RNM

This software is distributed as freeware. If you keep using this software, send me an appreciation or feedback e-mail for my programming effort and sharing this tool for free.
Or even better, buy me a coffee here.

Disclaimer:

This software and the accompanying files are supplied "as is", without any express or implied warranty.
In no event shall the author be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages from the use of this software.
By using this software you agree with these conditions.

Introduction:

DisCoverArt is a command line tool to download albumart (coverart) for mp3 music files based on artist and title or album.
The target audience are people who have organized their music collection in a single track artist+title way iso based on albums or album directories.
This tool can be used stand-alone, but it was aimed to be used in conjunction with the great software called mp3tag (http://www.mp3tag.de/).
But feel free to write your own batch script for downloading your albumart using DisCoverArt.
Below you will find the description for using DisCoverArt together with mp3tag to auto batch find and import albumart based on artist and title.
It was tested with mp3tag 2.54 but may work with earlier and later versions of mp3tag as well.

Installation:

Unzip DisCoverArt.exe and custommsgbox.dll from DisCoverArt.zip to a permanent directory (f.i. %programfiles%\Mp3tag).
Register custommsgbox.dll (created by westconn1):
open an elevated command prompt (cmd.exe as administrator) and type:
> cd C:\Program Files\Mp3tag (directory where you unzipped custommsgbox.dll)

regsvr32 custommsgbox.dll (a dialogbox will appear showing successful registration of the dll)

Description:

Usage: discoverart <artist> <title> <site> <quote> <short> <width> <height> <type> <num> <auto>
<artist> : name of the artist to search
<title>  : songtitle to search
<site>   : site to search, specify 'all' for all sites, -site to exclude a site (does not work since version 2.10.0.1)
<quote>  : 0=no quotes, 1=quote artist and title for literal search (this may reduce the number of results)
<short>  : 0=full title, 1=title part before - sign (for example titles from soundtracks who consist of 2 parts give better and uniform results)
<width>  : width of the image, 0=all size, 1=medium size (approx. 350 to 900 pixels)"
<height> : height of the image, 0=rectangle+square, 1=square"
<type>   : type of the image: jpg, gif, bmp, png, svg
<num>    : maximum number of images to download (1-20) (actual images downloaded may be less)
<auto>   : 0=manual single select image, 1=autosave all images

Examples:

Auto-download 1 jpg image with size 500x500 from the site discogs.com based on artist=Keane and title=Everybody's Changing (no quotes).
The image will be named: "Keane - Everybody's Changing.jpg":
discoverart "Keane" "Everybody's Changing" discogs.com 0 0 500 500 jpg 1 1

Auto-download 10 jpg images with size 300x300 from all sites, based on artist="Coldplay" and title="Viva La Vida" (note the quotes).
The images will be named: "Coldplay - Viva La Vida.jpg", "Coldplay - Viva La Vida1.jpg", "Coldplay - Viva La Vida2.jpg",...:

discoverart "Coldplay" "Viva La Vida" all 1 0 300 300 jpg 10 1

Manually select 1 jpg image with size 500x500 out of max. 5 suggestions from the site discogs.com based on artist=Keane and title=Everybody's Changing (no quotes).
The image will be named: "Keane - Everybody's Changing.jpg".
You will be presented with max. 5 images. You can select "Yes", this will keep the selected image; "No", this will continue to the next image; "Cancel", this will abort the search.

discoverart "Keane" "Everybody's Changing" discogs.com 0 0 500 500 jpg 5 0

Usage in conjunction with mp3tag (http://www.mp3tag.de/):

DisCoverArt was designed to be used in conjunction with a software called mp3tag (http://www.mp3tag.de/).
It has been tested that searching 300x300 images gives the best results. (500x500 is also an option, but gives less results).
Here are the possible suggestions to use DisCoverArt together with mp3tag.

Precondition: It is needed that at least the tags called "Artist" and "Title" are available in the mp3 files.
If not, you can easily derive these tags from the filename using mp3tag.
If the filename has the form "Artist - Title.mp3", select in the menu "Convert/Filename Tag" and use as the format string: %artist% - %title%.

Before using DisCoverArt, you should first make 3 definitions in mp3tag. One for auto-batch search and 2 for manual search. If you don't want to make these definitions manually, there is a configuration file for mp3tag available in DisCoverArt.zip called Mp3tagSettings.zip that you can unzip to %appdata%\mp3tag. Warning: these settings will overwrite your previous settings in mp3tag.
Here is the manual method:

Create a tool for the batch search 300x300:
In the menu, select "Tools/Options/Tools" and click on the button "New" (button with yellow star).
Name: "DisCoverArt Discogs 300x300 Artist+Title"
Path: select the path where you unzipped DisCoverArt.exe (f.i. C:\Program Files\Mp3tag) and select DisCoverArt.exe
Parameter: "%artist%" "%title%" discogs.com 0 1 300 300 jpg 1 1
Select the checkbox "For all selected files" and click "Ok".

Create another tool for the manual single search 300x300:
In the menu, select "Tools/Options/Tools" and click on the button "New" (button with yellow star).
Name: "DisCoverArt Discogs 300x300 Artist+Title Manual"
Path: select the path where you unzipped DisCoverArt.exe (f.i. C:\Program Files\Mp3tag) and select DisCoverArt.exe
Parameter: "%artist%" "%title%" discogs.com 0 1 300 300 jpg 20 0
Do not Select the checkbox "For all selected files" and click "Ok".

Create another tool for the manual single search 500x500:
In the menu, select "Tools/Options/Tools" and click on the button "New" (button with yellow star).
Name: "DisCoverArt Discogs 500x500 Artist+Title Manual"
Path: select the path where you unzipped DisCoverArt.exe (f.i. C:\Program Files\Mp3tag) and select DisCoverArt.exe
Parameter: "%artist%" "%title%" discogs.com 0 1 500 500 jpg 20 0
Do not Select the checkbox "For all selected files" and click "Ok".

Now you should also create 2 new actions in mp3tag: one to save coverart (and optionally another to delete coverart).

Create action to Save Coverart.
In the menu, select "Actions/Actions" and click on the button "New" (button with yellow star).
Name of action group: "Save Coverart", and click "Ok".
click on the button "New" (button with yellow star).
Select Action Type: "Import Cover From File"
Format string for image filename: %artist% - %title%.jpg
Import cover as: Front Cover.
Check: "Delete existing cover art" and click "Ok".

Create action to Delete Coverart.
In the menu, select "Actions/Actions" and click on the button "New" (button with yellow star).
Name of action group: "Delete Coverart", and click "Ok".
click on the button "New" (button with yellow star).
Select Action Type: "Remove fields"
Fields to remove: PICTURE

Now you can start importing coverart using mp3tag and DisCoverArt.
Important: existing coverart may be overwritten in the directory where the music file is located and also in the music file itself!

First load the directory where your mp3 files are located: In the menu, select "File/Change Directory" and select your mp3 directory.
It is handy to add a field "Cover" in the view to show and sort which mp3 files already have albumart/coverart.
To do that, right-click on the header of the table and select "Customize columns..." and check the label called "Cover" and click "Ok".
Now sort on that column "Cover". Those who already have coverart should show a 1, the others are empty.
Now multiple-select the "empty cover" music files (using shift or control key and mouse).
It is recommended to select a maximum of 300 mp3 files at once, otherwise your computer may slow down or results may be skipped, since queries are almost done simultaneously.
Now right-click on the selected mp3 files and select "Tools/DisCoverArt Discogs 300x300 Artist+Title"
Now you should see a number of black console windows popping up, one for each music file, doing a query using DisCoverArt.
Wait until all the console windows are closed.
Now DisCoverArt has created .jpg files with the name "Artist - Title.jpg" (note that existing jpg's with that name will be overwritten!).
Now you should batch import those .jpg files into the music files (keep the same music files select in mp3tag): from the menu select "Actions/Save Coverart"

Now you can walk over the music files in mp3tag and see/evaluate the imported coverart.

Sometimes it may occur that no coverart was found or that the imported jpg was not good.
In this case you can manually select an image to import as coverart.
Select only one mp3 file, right-click and select "Tools/DisCoverArt Discogs 300x300 Artist+Title Manual".
Now you can visually select the image you prefer: select "Yes", this will keep the selected image; "No", this will continue to the next image; "Cancel", this will abort the search.
After you selected an image, it is only downloaded to a file called "Artist - Title.jpg" (note that an existing jpg with that name may be overwritten!).
Now you should import this jpg file into the music file: while the mp3 file is still selected, from the menu select "Actions/Save Coverart".
If this method does not succeed, try a 500x500 search: "Tools/DisCoverArt Discogs 500x500 Artist+Title Manual"
If this method does not succeed, try a Medium+Square search: "Tools/DisCoverArt Discogs Medium+Square Artist+Title Manual"
If this method does not succeed, try a Medium search: "Tools/DisCoverArt Discogs Medium Artist+Title Manual"
You can always remove the saved coverart via: "Actions/Remove Coverart" one by one or in group. This will leave your mp3 files untouched!

Using this method you can easily and fast batch import albumart/coverart for your complete music mp3 library.
Have fun!

2 Likes

Sounds like a great idea.

AVG Anti-Virus Free (2013) identifies a Trojan Horse in that download.

Scanning on Virustotal gives a positive result of 10 Antivirus-Scanners of 45 total scanners for Malware.

I am totally unaware of a trojan in my executable. Could you please tell me what kind of trojan is there (name)? My tool is a vbscript compiled with ScriptCryptor, so there are no strange steps involved. Is it in de exe or in the dll? Maybe it is a false positive. I use Avast and I don't get any trojan warning. I would like to learn why there is a trojan warning.

I did not open the ZIP-File and made virustotal check the whole archive. There were different kinds of malware listed.
Compiled srcipts are often regarded as malware by virus-software.

You can test it yourself and upload your files here:
Virustotal

Ok, I will investigate deeper.

New version of DisCoverArt 2.3.0.3 released.
Download from: http://bit.ly/1Q3dq9R

Changes:
: width of the image, 0=all size, 1=medium size (approx. 350 to 900 pixels)
: height of the image, 0=rectangle+square, 1=square

This allows more combinations like:

Exact size: ex. w=300,h=300 or w=300,h=350 etc.
All sizes: w=0,h=0
All sizes, square: w=0,h=1
Medium sizes: w=1,h=0
Medium, Square: w=1,h=1

Tested with mp3tag 2.54

I solved the problem. A new version of DisCoverArt is available (see above version 2.3.0.3). If you scan it with Virustotal there are 0 trojans or malwares found.
Although I stay convinced that it was a false positive, since I read that also VB6 was tagged as a virus/trojan by f.i. Trend Micro. http://community.trendmicro.com/t5/Home-an...tive/td-p/95268
I got the same trojan detected called TROJ_GEN.F47V1210. I guess since VB6 and VBScript share some common parts, Trend Micro may have tagged it as a malware.
But anyway, as I said. This problem is now solved. DisCoverArt.zip and .exe is completely "clean".

1 Like

I have added 2 manual methods of searching: mediumsize+square jpg's and mediumsize jpg's.
I have also added a configuration file for mp3tag for those who don't want to configure mp3tag manually for use with DisCoverArt. The configuration file is now included in the download of DisCoverArt.zip. Warning: existing configuration settings of mp2tag will be overwritten.
You will find it here: http://bit.ly/1Q3dq9R

XploRR thanks for such a wonderful and very useful script !!

I have a large amount of electronic music collection, most of the mp3s without cover art, but I'm using the script and it's a charm ! works great.

Best regards

You're welcome!

I only miss one feature that i hope it's easy for you to add it. I need the capability to set the path where to save the downloaded image. A command line option like would be perfect. I hope you can add this feature as soon as possible

Unfortunately a few days this tool does not download anything .... we can hope in a fix coming soon?

I am investigating the problem.
Probably Google has changed the html return code.
Hope to fix it soon.

1 Like

The problem is fixed in version 2.4.0.1, however...
The previous version 2.3.0.2 stopped working because Google changed the format of the returned html code. Had to find a new method for retrieving the Google searchresults.
This new method also implies that Google no longer accepts multiple automated batch queries from within mp3tag (or others).
DisCoverArt will still work the first x automated queries, but your ip-address will be temporarily blocked by Google if you do continue after x+1 automated queries. You can however continue to use DisCoverArt for single albumart/coverart queries within mp3tag as long as Google detects that a human, not a program or bot, performs the queries.
You can download version 2.4.0.1 at http://bit.ly/1Q3dq9R under tools. A special thanks to Jerzy Siwinski for his scripting/testing support!

ok

Again Google changed the format of the returned html code.
The problem is fixed in version 2.5.0.1.
You can download version 2.5.0.1 at http://bit.ly/1Q3dq9R under tools.

the problem is...i want 1 folder.jpg (front cover for %artist% - %album%) but the tool downloads jpgs for every song in a weird way...this way its unusable!

I think the same as Koala. I don't see the benefit of you script, because the built-in function of MP3Tag is better and easier to use. And I have the same cover for every track in a folder.

But I see potential for your script. First, it should not download a cover for each track, only for each album. Then, it should be possible to call it from the root folder of my music folder and then go to each folder recursively and if it finds an mp3 file in an folder, it should download the cover as %artist% - %album% and then skip the other mp3's in that folder and go to the next. Also, there should be a parameter that existing covers will not be overwritten.

In the next step I can make a mass operation with MP3tag to set these covers for all my tracks that have no cover by adding the cover column and sort by that column.

But it would be much better, if your tool set the cover directly in the MP3 file so that MP3tag is not necessary.

I have a library of about 52.000 title, now you know what kind of tool I need... :slight_smile:

New version v.2.5.0.1 at site: http://bit.ly/1Q3dq9R (select tools/discoverart)