1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-20 05:38:46 +08:00

[Generic] Fix access to removed function in python 3.4

This commit is contained in:
rzhxeo 2014-05-22 09:13:28 +02:00
parent 11c78d1e07
commit 5e011e1505

View File

@ -308,9 +308,14 @@ class GenericIE(InfoExtractor):
newheaders = dict((k,v) for k,v in req.headers.items()
if k.lower() not in ("content-length", "content-type"))
try:
# This function was deprecated in python 3.3 and removed in 3.4
origin_req_host = req.get_origin_req_host()
except AttributeError:
origin_req_host = req.origin_req_host
return self.parent.open(compat_urllib_request.Request(req.get_full_url(),
headers=newheaders,
origin_req_host=req.get_origin_req_host(),
origin_req_host=origin_req_host,
unverifiable=True))
# Build our opener