compat_urllib_error,
compat_urllib_request,
compat_urllib_request_DataHandler,
- compat_urllib_request_Request,
)
from .utils import (
ContentTooShortError,
SameFileError,
sanitize_filename,
sanitize_path,
+ sanitized_Request,
std_headers,
subtitles_filename,
UnavailableVideoError,
return res
def _calc_cookies(self, info_dict):
- pr = compat_urllib_request.Request(info_dict['url'])
+ pr = sanitized_Request(info_dict['url'])
self.cookiejar.add_cookie_header(pr)
return pr.get_header('Cookie')
def urlopen(self, req):
""" Start an HTTP download """
if isinstance(req, compat_basestring):
- req = compat_urllib_request_Request(req)
+ req = sanitized_Request(req)
return self._opener.open(req, timeout=self._socket_timeout)
def print_debug_header(self):