mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 06:27:21 +00:00
Start counting from zero.
This commit is contained in:
parent
9438d15dff
commit
5c4df56d6d
|
@ -1620,7 +1620,7 @@ def extract_info(self, url, download=True, ie_key=None, extra_info=None,
|
||||||
def _handle_extraction_exceptions(func):
|
def _handle_extraction_exceptions(func):
|
||||||
@functools.wraps(func)
|
@functools.wraps(func)
|
||||||
def wrapper(self, *args, **kwargs):
|
def wrapper(self, *args, **kwargs):
|
||||||
wait_retries = 1
|
wait_retries = 0
|
||||||
max_wait_retries = self.params.get('wait_retries')
|
max_wait_retries = self.params.get('wait_retries')
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
@ -1628,9 +1628,9 @@ def wrapper(self, *args, **kwargs):
|
||||||
except (CookieLoadError, DownloadCancelled, LazyList.IndexError, PagedList.IndexError):
|
except (CookieLoadError, DownloadCancelled, LazyList.IndexError, PagedList.IndexError):
|
||||||
raise
|
raise
|
||||||
except ReExtractInfo as e:
|
except ReExtractInfo as e:
|
||||||
if wait_retries > max_wait_retries:
|
if wait_retries >= max_wait_retries:
|
||||||
if max_wait_retries > 0:
|
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:
|
else:
|
||||||
self.report_error('Video is still unavailable after waiting.')
|
self.report_error('Video is still unavailable after waiting.')
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue