Cover fetch from google and amazon does not work anymore

Bug #467711 reported by David Caro
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Listen
New
Undecided
Unassigned

Bug Description

On a fresh ubuntu 9.10 install, when you try to fetch a cover from google or amazon you get no results, and a message that says "INFO listen.widget.cover.CoverWindow 0xa3dd3ec failed retrieve amazon or google image information" or "Perhaps Google page structure has changed".

Using listen 0.6.2 from ubutu repositories.

A 'fast and dirty' fix to the problem is to change these lines of /usr/lib/lkisten/widget/cover.py:

356 def on_search_google_cb(self,html_handler,page):
357
358 html = html_handler.read()
359 #js_images = re.findall('[,\[]\[".*?,"1",\[\],""\]',html, re.S)
360 js_images = re.findall('\[\"/imgres[^"]*",\"[^"]*",\"[^"]*",\"([^"]*)",\"[^"]*",\"[^"]*",\"([^"]*)",\"[^"]*",\"[^"]*",\"([^"]*)",',html, re.S)
361 if not js_images :
362 self.logwarn("Perhaps Google page structure has changed")
363 self.fail_fetch()
364 return
365
366 mid = len(js_images)/2
367 if page%2==0:
368 js_images = js_images[ : mid-1 ]
369 else:
370 js_images = js_images[ mid : ]
371
372 items = []
373 for jsimg in js_images:
374 info = jsimg[1]
375 url = str(jsimg[0])
376 title = jsimg[2]
377 #title = unicode(title,errors="ignore")
378 #title = re.sub("<.*?>","",title)
379 items.append((url, title , info))
380
381 self.populate(page,items)

At least lets you fetch google covers :)

python version:Python 2.6.4rc2 (r264rc2:75497, Oct 20 2009, 02:55:11)
[GCC 4.4.1] on linux2

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.