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
the two sleeps in your script need a ; an the end
Elkin,
Thanks, I added them.
Jay
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.
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.
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!
Had same problem and Mike and Joel. Made the edits, and script seems to be running great. thx
Excellent script. Worked great for me without any editing (apart from the mysql username and password, of course). Thanks a bunch.
Just wanted to say thanks – this works perfectly with Mythbuntu 11.10
Glad it was useful to you!
I had to change the script to get it to fetch the album art, updates above.
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.
I certainly haven’t! But if you do, please let us know…I’ll be upgrading to .25 eventually.