add retries check

This commit is contained in:
Antonio J. Delgado 2025-08-10 12:25:03 +03:00
parent b54fcb68e1
commit 4e9f44a2d2

View file

@ -384,7 +384,12 @@ class GetYoutubeVideos:
if self.selected_proxy != '':
ydl_opts['proxy'] = self.selected_proxy
download_result = 'starting'
while 'downloaded' not in download_result and 'error' not in download_result:
retries = 0
while 'downloaded' not in download_result and 'error' not in download_result and retries < 30:
if retries > 0:
self._log.debug(
f"Retry: {retries}"
)
self._log.debug(
f"Download status: {download_result}"
)
@ -446,6 +451,7 @@ class GetYoutubeVideos:
self.summary['videos_with_error'] += 1
download_result = error
continue
retries += 1
else:
self._log.debug(
"Video with ID '%s' has been already downloaded",