A feature-rich command-line audio/video downloader
[utils] Remove Content-encoding from headers after decompression
Yen Chi Hsuanc047270c02be
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.pyindex 1737ac5f6d..0ed6c45c80 100644--- a/youtube_dl/utils.py+++ b/youtube_dl/utils.py@@ -773,11 +773,13 @@ class YoutubeDLHandler(compat_urllib_request.HTTPHandler):raise original_ioerrorresp = self.addinfourl_wrapper(uncompressed, old_resp.headers, old_resp.url, old_resp.code)resp.msg = old_resp.msg+ del resp.headers['Content-encoding']# deflateif resp.headers.get('Content-encoding', '') == 'deflate':gz = io.BytesIO(self.deflate(resp.read()))resp = self.addinfourl_wrapper(gz, old_resp.headers, old_resp.url, old_resp.code)resp.msg = old_resp.msg+ del resp.headers['Content-encoding']# Percent-encode redirect URL of Location HTTP header to satisfy RFC 3986 (see# https://github.com/rg3/youtube-dl/issues/6457).if 300 <= resp.code < 400: