mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-27 06:10:38 +01:00
Improve addinfourl_wrapper for compatibility with older Python versions
This commit is contained in:
parent
7b531c0be6
commit
0f6b00b587
|
@ -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…
Reference in New Issue
Block a user