show previous proxy
This commit is contained in:
parent
92b4b0c1c8
commit
643856a01b
1 changed files with 3 additions and 1 deletions
|
@ -190,6 +190,7 @@ class GetYoutubeVideos:
|
|||
def _change_proxy(self, video_id):
|
||||
less_failures = -1
|
||||
self._default_data['proxies'][self.selected_proxy]['failures'] += 1
|
||||
previous_proxy = self.selected_proxy
|
||||
for proxy in self._default_data['proxies']:
|
||||
if less_failures == -1 or self._default_data['proxies'][proxy]['failures'] < less_failures:
|
||||
less_failures = self._default_data['proxies'][proxy]['failures']
|
||||
|
@ -200,7 +201,8 @@ class GetYoutubeVideos:
|
|||
"All proxies have the same number of errors, using first proxy of the list."
|
||||
)
|
||||
self._log.warning(
|
||||
"Got an error fetching video information. Setting proxy to '%s'...",
|
||||
"Got an error fetching video information with proxy '%s'. Setting proxy to '%s'...",
|
||||
previous_proxy,
|
||||
self.selected_proxy
|
||||
)
|
||||
return self._get_video_info(video_id)
|
||||
|
|
Loading…
Reference in a new issue