aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/downloader/http.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/downloader/http.py')
-rw-r--r--yt_dlp/downloader/http.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/yt_dlp/downloader/http.py b/yt_dlp/downloader/http.py
index 95c870ee8..fa72d5722 100644
--- a/yt_dlp/downloader/http.py
+++ b/yt_dlp/downloader/http.py
@@ -211,7 +211,12 @@ class HttpFD(FileDownloader):
ctx.stream = None
def download():
- data_len = ctx.data.info().get('Content-length', None)
+ data_len = ctx.data.info().get('Content-length')
+
+ if ctx.data.info().get('Content-encoding'):
+ # Content-encoding is present, Content-length is not reliable anymore as we are
+ # doing auto decompression. (See: https://github.com/yt-dlp/yt-dlp/pull/6176)
+ data_len = None
# Range HTTP header may be ignored/unsupported by a webserver
# (e.g. extractor/scivee.py, extractor/bambuser.py).