From daafbf49b3482edae4d70dd37070be99742a926e Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Sat, 27 May 2023 22:40:05 +1200 Subject: [PATCH] [core] Support decoding multiple content encodings (#7142) Authored by: coletdjnz --- test/test_http.py | 76 ++++++++++++++++++++++++++++++++++++++++++ yt_dlp/utils/_utils.py | 61 +++++++++++++++++---------------- 2 files changed, 108 insertions(+), 29 deletions(-) diff --git a/test/test_http.py b/test/test_http.py index d684905da..3941a6e77 100644 --- a/test/test_http.py +++ b/test/test_http.py @@ -17,9 +17,11 @@ import threading import urllib.error import urllib.request +import zlib from test.helper import http_server_port from yt_dlp import YoutubeDL +from yt_dlp.dependencies import brotli from yt_dlp.utils import sanitized_Request, urlencode_postdata from .helper import FakeYDL @@ -148,6 +150,31 @@ def do_GET(self): self.send_header('Location', new_url) self.send_header('Content-Length', '0') self.end_headers() + elif self.path == '/content-encoding': + encodings = self.headers.get('ytdl-encoding', '') + payload = b'