notamused.org

Your Ad Here

Album Cover Art Downloader crashes when using Amazon

Earlier this month (Feb 08) my Album Cover Art Downloader kept spitting out errors when using Amazon to find artwork. Here is a copy of the error:

Traceback (most recent call last):

File “/usr/lib/albumart/process.py”, line 130, in run
for cover in albumart.getAvailableCovers(artist, album, requireExactMatch = self.requireExactMatch):

File “/usr/lib/albumart/albumart.py”, line 115, in getAvailableCovers
results += s.findAlbum(”%s %s” % (artist, album))

File “/usr/lib/albumart/albumart_source_amazon.py”, line 49, in findAlbum
return amazon.searchByKeyword(name,type=”lite”,product_line=”music”)

File “/usr/lib/albumart/amazon.py”, line 315, in searchByKeyword
return search(”KeywordSearch”, keyword, product_line, type, page, license_key, http_proxy, locale, associate)

File “/usr/lib/albumart/amazon.py”, line 293, in search
xmldoc = minidom.parse(usock)

File “/usr/lib/python2.5/xml/dom/minidom.py”, line 1913, in parse
return expatbuilder.parse(file)

File “/usr/lib/python2.5/xml/dom/expatbuilder.py”, line 928, in parse
result = builder.parseFile(file)

File “/usr/lib/python2.5/xml/dom/expatbuilder.py”, line 207, in parseFile
parser.Parse(buffer, 0)

ExpatError: not well-formed (invalid token): line 24, column 19

Googling lines from the error led me to this blog written by Rich Burridge: http://blogs.sun.com/richb/entry/updated_be_informed_when_used. Seems Amazon changed their system around slightly which was causing errors in a python library. Since the error was so similar, I asked him for help and he kindly told me how to fix it.

In the file “albumart_source_amazon.py” add a “time.sleep(2)” right before line 48 so it reads:

time.sleep(2)
return amazon.searchByKeyword(name,type=”lite”,product_line=”music”)

That is actually only two lines, sorry for the column width wrap-around. Please note its very important for the tab spaces to line up evenly. The script will run slower, but with no errors. Thank you Rich for this temporary fix until someone releases a new version of Album Cover Art Downloader.

How to install Flash for Firefox 3 beta in Ubuntu

First make sure you have the Adobe Flash plugin installed. It is not packaged with any version of Firefox.

$ sudo update-flashplugin
$ sudo apt-get install flashplugin-nonfree

This package of flashplugin-nonfree was made before the Firefox3 pre-releases, so we have to add it to the libraries manually. This method will “link” it from the default install location (not just copy it) so in case you upgrade flashplugin-nonfree in the future, it will be updated for Firefox3 as well.

$ sudo ln -s /usr/lib/firefox/plugins/flashplugin-alternative.so /usr/lib/firefox-3.0b3/plugins/flashplugin-alternative.so

If you are using a different version of Firefox3 than I am (firefox3.0b3) you’ll need to modify that line. To test if it worked go to a flash site such as YouTube.com.