Browse Source

Improve addinfourl_wrapper for compatibility with older Python versions

master
Ricardo Garcia 14 years ago
parent
commit
0f6b00b587
1 changed files with 3 additions and 1 deletions
  1. 4
      youtube-dl

4
youtube-dl

@ -193,7 +193,9 @@ class YoutubeDLHandler(urllib2.HTTPHandler):
def addinfourl_wrapper(stream, headers, url, code):
if hasattr(urllib2.addinfourl, 'getcode'):
return urllib2.addinfourl(stream, headers, url, code)
return urllib2.addinfourl(stream, headers, url)
ret = urllib2.addinfourl(stream, headers, url)
ret.code = code
return ret
def http_request(self, req):
for h in std_headers:

Loading…
Cancel
Save