aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r--yt_dlp/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index a08dc3c11..c71a7b833 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -159,7 +159,6 @@ if compat_brotli:
std_headers = {
'User-Agent': random_user_agent(),
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'Accept-Encoding': ', '.join(SUPPORTED_ENCODINGS),
'Accept-Language': 'en-us,en;q=0.5',
'Sec-Fetch-Mode': 'navigate',
}
@@ -1401,6 +1400,9 @@ class YoutubeDLHandler(compat_urllib_request.HTTPHandler):
if h.capitalize() not in req.headers:
req.add_header(h, v)
+ if 'Accept-encoding' not in req.headers:
+ req.add_header('Accept-encoding', ', '.join(SUPPORTED_ENCODINGS))
+
req.headers = handle_youtubedl_headers(req.headers)
if sys.version_info < (2, 7) and '#' in req.get_full_url():