A feature-rich command-line audio/video downloader
[fd/http] Reset resume length to handle `FileNotFoundError` (#8399)
Peter Hosey2d91b9845621
diff --git a/yt_dlp/downloader/http.py b/yt_dlp/downloader/http.pyindex f5237443e2..693828b6e5 100644--- a/yt_dlp/downloader/http.py+++ b/yt_dlp/downloader/http.py@@ -237,8 +237,13 @@ class HttpFD(FileDownloader):def retry(e):close_stream()- ctx.resume_len = (byte_counter if ctx.tmpfilename == '-'- else os.path.getsize(encodeFilename(ctx.tmpfilename)))+ if ctx.tmpfilename == '-':+ ctx.resume_len = byte_counter+ else:+ try:+ ctx.resume_len = os.path.getsize(encodeFilename(ctx.tmpfilename))+ except FileNotFoundError:+ ctx.resume_len = 0raise RetryDownload(e)while True: