diff options
author | Felix Yan <felixonmars@archlinux.org> | 2023-02-17 05:08:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-17 08:38:45 +0530 |
commit | 65e5c021e7c5f23ecbc6a982b72a02ac6cd6900d (patch) | |
tree | 91a6617854976065e04a49a2f8be10df801f4de2 /yt_dlp/utils.py | |
parent | a9189510baadf0dccd2d4d363bc6f3a441128bb0 (diff) | |
download | hypervideo-pre-65e5c021e7c5f23ecbc6a982b72a02ac6cd6900d.tar.lz hypervideo-pre-65e5c021e7c5f23ecbc6a982b72a02ac6cd6900d.tar.xz hypervideo-pre-65e5c021e7c5f23ecbc6a982b72a02ac6cd6900d.zip |
[utils] Don't use Content-length with encoding (#6176)
Authored by: felixonmars
Closes #3772, #6178
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r-- | yt_dlp/utils.py | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 7cf151e3a..2d9e61c5b 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -1438,19 +1438,16 @@ class YoutubeDLHandler(urllib.request.HTTPHandler): raise original_ioerror resp = urllib.request.addinfourl(uncompressed, old_resp.headers, old_resp.url, old_resp.code) resp.msg = old_resp.msg - del resp.headers['Content-encoding'] # deflate if resp.headers.get('Content-encoding', '') == 'deflate': gz = io.BytesIO(self.deflate(resp.read())) resp = urllib.request.addinfourl(gz, old_resp.headers, old_resp.url, old_resp.code) resp.msg = old_resp.msg - del resp.headers['Content-encoding'] # brotli if resp.headers.get('Content-encoding', '') == 'br': resp = urllib.request.addinfourl( io.BytesIO(self.brotli(resp.read())), 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/ytdl-org/youtube-dl/issues/6457). if 300 <= resp.code < 400: |