mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-14 01:05:06 +00:00
[downloader/http] Request last data block of exact remaining size
Always request last data block of exact size remaining to download if possible not the current block size.
This commit is contained in:
parent
f7b42518dc
commit
6c907eb33f
1 changed files with 1 additions and 1 deletions
|
@ -227,7 +227,7 @@ def retry(e):
|
|||
while True:
|
||||
try:
|
||||
# Download and write
|
||||
data_block = ctx.data.read(block_size if not is_test else min(block_size, data_len - byte_counter))
|
||||
data_block = ctx.data.read(block_size if data_len is None else min(block_size, data_len - byte_counter))
|
||||
# socket.timeout is a subclass of socket.error but may not have
|
||||
# errno set
|
||||
except socket.timeout as e:
|
||||
|
|
Loading…
Reference in a new issue