1
0
mirror of https://github.com/l1ving/youtube-dl synced 2020-11-18 19:53:54 -08:00

[fix] _get_cookies on Python 2

This commit is contained in:
Sylvain CECCHETTO 2020-04-14 09:50:18 +02:00
parent 00eb865b3c
commit 50c217caa8

View File

@ -2830,7 +2830,10 @@ class InfoExtractor(object):
""" Return a compat_cookies.SimpleCookie with the cookies for the url """
req = sanitized_Request(url)
self._downloader.cookiejar.add_cookie_header(req)
return compat_cookies.SimpleCookie(req.get_header('Cookie'))
cookie_header = req.get_header('Cookie')
if sys.version_info[0] == 2:
cookie_header = str(cookie_header)
return compat_cookies.SimpleCookie(cookie_header)
def _apply_first_set_cookie_header(self, url_handle, cookie):
"""