Comment 2 for bug 830255

Revision history for this message
Markus Berndt (markus-berndt) wrote : Re: album art/ cover art

I have the same problem. I am using pithos through a proxy that is defined using the http_proxy environment variable. I took a quick look at the relevant function in the source and managed to fix it for my situation:

In the file /usr/bin/pithos change the function get_album_art as follows. The commented out line below is the original, while the line below the commented out one is new.

def get_album_art(url, proxy, *extra):
     proxies = {"http": proxy} if proxy else {};
     # content = urllib.urlopen(url, proxies=proxies).read()
     content = urllib.urlopen(url).read()
     l = gtk.gdk.PixbufLoader()
     l.set_size(ALBUM_ART_SIZE, ALBUM_ART_SIZE)
     l.write(content)
     l.close()
     return (l.get_pixbuf(),) + extra

When the environment variable http_proxy is set, proxy is empty, which results in proxies to equal {} which in turn trips up the urllib.urlopen method. It seems that proxy only has a value if it is set through pithos' settings menu.

On ubuntu 11.10, the http_proxy and https_proxy variables are set if one configures a proxy server as a system default through the system settings gui. Since the new authentication uses ssl, I need to go through the proxy for that, too, but I can only configure a proxy for http in the pithos settings. Leaving these settings blank, pithos picks up my system https proxy though, so I can use pithos.

(I am using pithos version 0.3.13, from the ppa on ubuntu 11.10).