diff -Nur -x '*.orig' -x '*~' listen/src/widget/cover.py listen.new/src/widget/cover.py --- listen/src/widget/cover.py 2009-07-30 18:29:09.000000000 +0200 +++ listen.new/src/widget/cover.py 2009-11-07 17:29:06.265424955 +0100 @@ -355,7 +355,7 @@ def on_search_google_cb(self,html_handler,page): html = html_handler.read() - js_images = re.findall('[,\[]\[".*?,"1",\[\],""\]',html, re.S) + js_images = re.findall('\[\"/imgres[^"]*",\"[^"]*",\"[^"]*",\"([^"]*)",\"[^"]*",\"[^"]*",\"([^"]*)",\"[^"]*",\"[^"]*",\"([^"]*)",',html, re.S) if not js_images : self.logwarn("Perhaps Google page structure has changed") self.fail_fetch() @@ -369,13 +369,12 @@ items = [] for jsimg in js_images: - info = [ info.replace('"','') for info in re.findall('".*?"', jsimg, re.S) ] - url = str(info[3]) - title = info[6] - title = unicode(title,errors="ignore") - title = re.sub("<.*?>","",title) - items.append((url, title ,"")) - + info = jsimg[1] + info = info.replace('\\x3cb\\x3e','') + info = info.replace('\\x3c/b\\x3e','') + url = str(jsimg[0]) + title = jsimg[2] + items.append((url, title , info)) self.populate(page,items)