From 8738407d77f6da843f8f5ded1ccad73172b4abac Mon Sep 17 00:00:00 2001 From: dirkf Date: Sun, 2 Mar 2025 13:36:05 +0000 Subject: [PATCH] [compat] Support zstd Content-Encoding * see RFC 8878 7.2 --- youtube_dl/compat.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py index e617dd511..6cd7abd24 100644 --- a/youtube_dl/compat.py +++ b/youtube_dl/compat.py @@ -3561,6 +3561,13 @@ try: except ImportError: compat_ncompress = None +# compat_zstandard +# PyPi zstandard package implements 'zstd' Content-Encoding (RFC 8878 7.2) +try: + import zstandard as compat_zstandard +except ImportError: + compat_zstandard = None + legacy = [ 'compat_HTMLParseError', @@ -3658,4 +3665,5 @@ __all__ = [ 'compat_xml_etree_register_namespace', 'compat_xpath', 'compat_zip', + 'compat_zstandard', ]