From 5c4df56d6d70e2a8e0ea50968e6bd6923b5a06d1 Mon Sep 17 00:00:00 2001 From: Paul Storkman Date: Thu, 31 Oct 2024 14:10:47 +0100 Subject: [PATCH] Start counting from zero. --- yt_dlp/YoutubeDL.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 919c8f6a5..db173921f 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -1620,7 +1620,7 @@ class YoutubeDL: def _handle_extraction_exceptions(func): @functools.wraps(func) def wrapper(self, *args, **kwargs): - wait_retries = 1 + wait_retries = 0 max_wait_retries = self.params.get('wait_retries') while True: try: @@ -1628,9 +1628,9 @@ class YoutubeDL: except (CookieLoadError, DownloadCancelled, LazyList.IndexError, PagedList.IndexError): raise except ReExtractInfo as e: - if wait_retries > max_wait_retries: + if wait_retries >= max_wait_retries: if max_wait_retries > 0: - self.report_error(f'Giving up after {wait_retries - 1} {"retries" if wait_retries > 2 else "retry"} while waiting.') + self.report_error(f'Giving up after {wait_retries} {"retries" if wait_retries > 2 else "retry"} while waiting.') else: self.report_error('Video is still unavailable after waiting.') return