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.
