Screen Scraping Amazon Album Art for MythTV

mythtv icon

I wanted to get Album Art for all of my (newly ripped) songs on my MythTV box. 

Thierry has a nice perl script which finds album art on Amazon and automatically downloads it, but unfortunately for me the music plugin for MythTV has upgraded their database schema and the script no longer worked.  I am using the trunk SVN code, so it's a bit more up-to-date than the latest packaged release, but this means that scripts designed for the packaged versions may not work. (This specific script had a problem finding the correct directory to store the album art, so all the album art was stored in the root directory, overwriting itself with each album.)

Luckily, I know just enough SQL and Perl to be dangerous, so I whipped up a few changes to his code that fixed my problem (after exploring the new database format). The updated script is here if anybody needs it.

UPDATE: I also added features that allow you to run the script multiple times (if an albumart.jpg file already exists, it will skip that album) and improved the searching (if "album by artist" is not found, it will try searching by "album" name only).

Updated New File: amazon_album_art_scraper.txt (Thanks to Mike Wilson for updates to Amazon’s HTML!)

OLD FILE: Amazon Album Art Scraper Script

12 thoughts on “Screen Scraping Amazon Album Art for MythTV

  1. great tool i’m very impressed, i found mine wouldn’t locate the directory because it was missing the / in between

    $filename = “$directory$dirname/albumart.jpg”;

    So just add it in
    $filename = “$directory/$dirname/albumart.jpg”;

    I tried adding the / in the myth setup but that didn’t fix it.
    cheers.

  2. I ran into the same problem as Mike, but edited the perl script myself and its going full steam ahead now. Thanks for this.

    By the way, it works on the latest Mythbuntu just fine.

  3. I changed the die, right at the end, it’s better to go to the next item rather than just give up if you can’t save the file (IMHO) I have a few incorrect DB entries…
    Cheers tho, handy script!

  4. Has anyone tested this on a .25 installation? I just upgraded and I am looking for a solution that will work. I see that .25 changed the frontend of mythmusic a lot, I don’t know how much changed under the hood though.

Leave a Reply

Your email address will not be published.