add retries check
This commit is contained in:
parent
b54fcb68e1
commit
4e9f44a2d2
1 changed files with 7 additions and 1 deletions
|
@ -384,7 +384,12 @@ class GetYoutubeVideos:
|
||||||
if self.selected_proxy != '':
|
if self.selected_proxy != '':
|
||||||
ydl_opts['proxy'] = self.selected_proxy
|
ydl_opts['proxy'] = self.selected_proxy
|
||||||
download_result = 'starting'
|
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(
|
self._log.debug(
|
||||||
f"Download status: {download_result}"
|
f"Download status: {download_result}"
|
||||||
)
|
)
|
||||||
|
@ -446,6 +451,7 @@ class GetYoutubeVideos:
|
||||||
self.summary['videos_with_error'] += 1
|
self.summary['videos_with_error'] += 1
|
||||||
download_result = error
|
download_result = error
|
||||||
continue
|
continue
|
||||||
|
retries += 1
|
||||||
else:
|
else:
|
||||||
self._log.debug(
|
self._log.debug(
|
||||||
"Video with ID '%s' has been already downloaded",
|
"Video with ID '%s' has been already downloaded",
|
||||||
|
|
Loading…
Reference in a new issue