aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-04-05 21:31:59 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-04-05 21:31:59 +0530
commitce0593ef61a3da2ac296a8e791bbb0c6e356c05a (patch)
tree8812eca817d3667d384c0709348c1cc330361f67
parenta44ca5a470e09b5170fc9c3a46733f050fadbfae (diff)
downloadhypervideo-pre-ce0593ef61a3da2ac296a8e791bbb0c6e356c05a.tar.lz
hypervideo-pre-ce0593ef61a3da2ac296a8e791bbb0c6e356c05a.tar.xz
hypervideo-pre-ce0593ef61a3da2ac296a8e791bbb0c6e356c05a.zip
[http] Fix #3215
-rw-r--r--yt_dlp/downloader/http.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt_dlp/downloader/http.py b/yt_dlp/downloader/http.py
index 591a9b08d..a232168fa 100644
--- a/yt_dlp/downloader/http.py
+++ b/yt_dlp/downloader/http.py
@@ -145,7 +145,8 @@ class HttpFD(FileDownloader):
or content_len < range_end)
if accept_content_len:
ctx.content_len = content_len
- ctx.data_len = min(content_len, req_end or content_len) - (req_start or 0)
+ if content_len or req_end:
+ ctx.data_len = min(content_len or req_end, req_end or content_len) - (req_start or 0)
return
# Content-Range is either not present or invalid. Assuming remote webserver is
# trying to send the whole file, resume is not possible, so wiping the local file