[extractor/common] fix _get_cookies method for python 2(#20673, #2325…
…6, #20326, closes #28640)
This commit is contained in:
parent
56e1b36377
commit
ecfbf64895
|
@ -2985,7 +2985,10 @@ class InfoExtractor(object):
|
||||||
""" Return a compat_cookies.SimpleCookie with the cookies for the url """
|
""" Return a compat_cookies.SimpleCookie with the cookies for the url """
|
||||||
req = sanitized_Request(url)
|
req = sanitized_Request(url)
|
||||||
self._downloader.cookiejar.add_cookie_header(req)
|
self._downloader.cookiejar.add_cookie_header(req)
|
||||||
return compat_cookies.SimpleCookie(req.get_header('Cookie'))
|
cookie = req.get_header('Cookie')
|
||||||
|
if cookie and sys.version_info[0] == 2:
|
||||||
|
cookie = str(cookie)
|
||||||
|
return compat_cookies.SimpleCookie(cookie)
|
||||||
|
|
||||||
def _apply_first_set_cookie_header(self, url_handle, cookie):
|
def _apply_first_set_cookie_header(self, url_handle, cookie):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue