mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-01 12:05:26 +02:00
[fd/http] Reset resume length to handle FileNotFoundError
(#8399)
Closes #4521 Authored by: boredzo
This commit is contained in:
parent
8828f4576b
commit
2d91b98456
@ -237,8 +237,13 @@ def download():
|
|||||||
|
|
||||||
def retry(e):
|
def retry(e):
|
||||||
close_stream()
|
close_stream()
|
||||||
ctx.resume_len = (byte_counter if ctx.tmpfilename == '-'
|
if ctx.tmpfilename == '-':
|
||||||
else os.path.getsize(encodeFilename(ctx.tmpfilename)))
|
ctx.resume_len = byte_counter
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
ctx.resume_len = os.path.getsize(encodeFilename(ctx.tmpfilename))
|
||||||
|
except FileNotFoundError:
|
||||||
|
ctx.resume_len = 0
|
||||||
raise RetryDownload(e)
|
raise RetryDownload(e)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
Loading…
Reference in New Issue
Block a user