Automatic AMG song searching


This is for desparate people like me, who own thousands of mp3s with no other info than artist and title name known.

After nearly 2 weeks of development my 2nd, and much more promising attempt to incoorporate the ability to search for multiple songs on AMG into mp3tag has reached beta stage.

Multiple song search can't be archieved with mp3tag's internal tools so I had to switch to external ones.

What this is:

This is a Perl script that uses csv files to export/import tags from and to mp3tag. It searches AMG for the artist; browses the artist's song list for the song; the song's details for the album (selected by string comparison, or if no album info present by release date) and the album details for the track number. All choices are based on a fuzzy string compare function with seperately comfigurable accuracy thresholds. If no matching song is found an error message including the name of the best match is returned in the Comment tag. The script is also capable to store all downloaded webpages in a local hdd cache which greatly improves speed when searching for multiple songs of the same artist.
The script has been designed to search for single songs, but it should be able to find whole albums too. Besides it shouldn't be too difficult to rewrite the script to search for other information or even to search other websites.

Retrieved tags:

Artist, Title, Album, Track, Year,
Album Rating, Composer, Publisher, Type, Genre, Style, Mood,
Theme, Comment (AMG Album ID or Script Errormsg),
CoverUrl, ArtistAcc (accuracy of artist match),
TitleAcc (accuracy of title match), Duration


  1. Export the tags of the songs to be searched in a semicolon separated list with the provided export script (beware of semicolons or newlines in the tags!)

  2. Run the Perl script to do a song by song search on
    (type 'perl ' in a command shell)
    To run the script you will need a recent version of Perl and the additional Perl packages String-Compare and Text-Trim.
    Optional: adjust the script's settings by editing it with a text editor.

  3. Import the tags again using textfile to tag import and following format string (without newlines):


%Album Rating%;%Composer%;%Publisher%;%Type%;%Genre%;%Style%;

(replace the tags you don't want with %dummy%)

Known issues:

No real support for covers (the script gets the urls, but it doesn't download the covers). To really get the covers you could use a tool like wget combined with a mp3tag export script.

The script is a little picky with typos in the tags.

The tags are always exported ordered by filename.

Comments, improvements and bug reports are always welcome.

Stef (11.7 KB)


This sounds interesting, though 1) I can't get that 'Perl' site to come up 2) Does this work on Windows? I read a few things and this Perl seems geared more-so toward Linux and such... so... :S


Perl works on Windows, yes. The Active State site works fine for me now.


About the script:
I wrote the script using Active Perl for Windows. So it will work on Windows. The script uses Windows-style fileseparators and path names but apart from that it should run on Unix OSes too.

About Perl:
Perl is a programming language like c++ or Java. There are Perl implementations for almost every OS ever made. It has some features which make it suitable for programming webspiders like automatic memory management or regex (and lots of features which make Perl programming a real pain for newcomers like me). I linked to the Active Perl homepage in my first post because it is afaik the standard implementation of Perl (like Sebastian said: the link should be fine, btw.). But I am by no means an expert with Perl. Anyway, I like the packet manager that comes with Active Perl and, of course: its free. For more information on Perl is the place to go.


Hi tasmanian, I've tried to send you a forum PM, but it seems you didn't have activated this forum feature. Please activate PM.


Hmm... I've checked my "Disable your personal messenger?" setting and its set to no. Still, if I try to send a pm I get a "You are not allowed to use the messenger feature on this board" error message. Note that it says I am not allowed, it doesn't say I disabled the messenger. I tried to set the setting to yes with no difference and I couldn't find any other options related to pms in my configuration. Looks like its no pms for me, sorry. If you want to discuss something in private try sending me an email.


PMs are disabled for users who have < 5 posts on this forum (due to massive misuse).


now, this should be easy to fix :slight_smile:

allright, I am now able to send and receive pms.