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).

Amazon Album Art Scraper Script

Related posts:

  1. How to move a mythtv database from one machine to another
  2. MythTV to phone (.3gp) transcoder script and Bluetooth transfer
  3. Mythtv gotchas when upgrading from Ubuntu 7.04 (Feisty) to 7.10 (Gutsy)

6 comments ↓

#1 elkin on 09.24.08 at 8:24 am

the two sleeps in your script need a ; an the end

#2 Jay on 09.24.08 at 9:05 am

Elkin,
Thanks, I added them.
Jay

#3 mike on 09.27.08 at 1:15 pm

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.

#4 Joel on 09.28.08 at 9:47 am

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.

#5 Mark Edwards on 12.09.08 at 1:56 pm

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!

#6 Darrell Dillman on 02.07.09 at 10:08 pm

Had same problem and Mike and Joel. Made the edits, and script seems to be running great. thx

Leave a Comment