Commits

A2K  committed 6ebca52

Icluded patch from issue 28 (playing through proxy)

  • Participants
  • Parent commits 8c8f0ad

Comments (0)

Files changed (1)

 from vplayer.track import Track
 from vplayer.tagreader import decoder
 
+from urllib import getproxies
 
 class DownloadError(Exception):
     pass
     def download(self, url, start = None, status = None, end = None):
 
         addr = httplib.urlsplit(url)
-        conn = httplib.HTTPConnection(addr.netloc)
+	try:
+            proxy = getproxies()['http']
+            host, port = proxy.split(':')
+            conn = httplib.HTTPConnection(host, port)
+        except:
+            conn = httplib.HTTPConnection(addr.netloc)
         try:
-            conn.request("GET", addr.path)
+            conn.request("GET", url)
         except:
             raise DownloadError()
         r1 = conn.getresponse()