Package: xmms-coverviewer
Version: 0.11-5
Severity: normal

When using xmms-coverviewer, the python backend script that retrieves the
cover images sometimes throws on exception.

These exceptions occur on searching Darktown or Google for images.
I made a simple patch which adds a few extra checks to the script.

--- script.py.org       2005-11-05 14:42:29.000000000 +0100
+++ script.py   2005-11-05 14:50:55.000000000 +0100
@@ -221,6 +221,8 @@
                print URLDARK
        conn = urllib.urlopen(URLDARK+"a.jpg")
        data = conn.read()
+       if (len(data)<5):
+               return
        BUFF=data[2]+data[3]+data[4]
        if (not(re.search("DOC", BUFF))):
                #Hurray, we've found something
@@ -231,6 +233,8 @@
                #Maybe a back cover too?
                conn = urllib.urlopen(URLDARK+"b.jpg")
                data = conn.read()
+               if (len(data)<5):
+                       return
                BUFF=data[2]+data[3]+data[4]
                if (not(re.search("DOC", BUFF))):
                        #Yes, back is there too!
@@ -298,7 +302,9 @@
                        cprint("Cover "+str(nbimage)+" found on
images.google.com")
                image_url=string.replace(s.group(),"imgurl=","")
                image_url=string.replace(image_url,"&imgrefurl","")
-                conn = urllib.urlopen("http://"+image_url)
+               if (image_url[:7]!="http://";):
+                       image_url = "http://"+image_url
+                conn = urllib.urlopen(image_url)
                data = conn.read()
                 BUFF=data[2]+data[3]+data[4]
                 if (not(re.search("DOC", BUFF))):

Using latest Debian unstable (updated to 5 nov)

Regards,
Bas



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to