diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-09-06 07:53:11 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-09-06 07:53:11 +0600 |
commit | 266e466ee48f510226de9c7eb99f8727c99175bc (patch) | |
tree | 16e3e2ef067b90ee8d78f6a8b1c287eea8bb346d /youtube_dl/utils.py | |
parent | cf83f532ae8a21dd58e7506d1496f611c372f861 (diff) |
[utils] Simplify cookie processor
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 5529d5291..9c547729e 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -797,9 +797,7 @@ class YoutubeDLCookieProcessor(compat_urllib_request.HTTPCookieProcessor): for set_cookie_header in ('Set-Cookie', 'Set-Cookie2'): set_cookie = response.headers.get(set_cookie_header) if set_cookie: - set_cookie_escaped = '; '.join([ - escape_rfc3986(cookie_attr.strip()) - for cookie_attr in set_cookie.decode('iso-8859-1').split(';')]).encode('iso-8859-1') + set_cookie_escaped = compat_urllib_parse.quote(set_cookie, b"%/;:@&=+$,!~*'()?#[] ") if set_cookie != set_cookie_escaped: del response.headers[set_cookie_header] response.headers[set_cookie_header] = set_cookie_escaped |