mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-22 06:00:00 +00:00
[downloader/http] Avoid infinite loop when no data is received
Closes #7504
This commit is contained in:
parent
6355b5f1e1
commit
662ef1e910
1 changed files with 5 additions and 5 deletions
|
@ -339,15 +339,15 @@ def retry(e):
|
||||||
elif speed:
|
elif speed:
|
||||||
ctx.throttle_start = None
|
ctx.throttle_start = None
|
||||||
|
|
||||||
if not is_test and ctx.chunk_size and ctx.content_len is not None and byte_counter < ctx.content_len:
|
|
||||||
ctx.resume_len = byte_counter
|
|
||||||
# ctx.block_size = block_size
|
|
||||||
raise NextFragment()
|
|
||||||
|
|
||||||
if ctx.stream is None:
|
if ctx.stream is None:
|
||||||
self.to_stderr('\n')
|
self.to_stderr('\n')
|
||||||
self.report_error('Did not get any data blocks')
|
self.report_error('Did not get any data blocks')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if not is_test and ctx.chunk_size and ctx.content_len is not None and byte_counter < ctx.content_len:
|
||||||
|
ctx.resume_len = byte_counter
|
||||||
|
raise NextFragment()
|
||||||
|
|
||||||
if ctx.tmpfilename != '-':
|
if ctx.tmpfilename != '-':
|
||||||
ctx.stream.close()
|
ctx.stream.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue