replace elifs
This commit is contained in:
parent
97129c6a21
commit
01b7a48bc7
1 changed files with 9 additions and 10 deletions
|
@ -108,14 +108,14 @@ class GetYoutubeVideos:
|
||||||
if not result:
|
if not result:
|
||||||
return None
|
return None
|
||||||
return result
|
return result
|
||||||
elif 'HTTP Error 403: Forbidden' in f"{error}":
|
if 'HTTP Error 403: Forbidden' in f"{error}":
|
||||||
self.summary['videos_with_error'] += 1
|
self.summary['videos_with_error'] += 1
|
||||||
self.summary['possible_proxy_errors'] += 1
|
self.summary['possible_proxy_errors'] += 1
|
||||||
result = self._change_proxy(video_id)
|
result = self._change_proxy(video_id)
|
||||||
if not result:
|
if not result:
|
||||||
return None
|
return None
|
||||||
return result
|
return result
|
||||||
elif 'not a bot' in f"{error}":
|
if 'not a bot' in f"{error}":
|
||||||
self.summary['videos_with_error'] += 1
|
self.summary['videos_with_error'] += 1
|
||||||
self.summary['possible_ban_errors'] += 1
|
self.summary['possible_ban_errors'] += 1
|
||||||
# elif age_limit_errors?
|
# elif age_limit_errors?
|
||||||
|
@ -123,14 +123,13 @@ class GetYoutubeVideos:
|
||||||
if not result:
|
if not result:
|
||||||
return None
|
return None
|
||||||
return result
|
return result
|
||||||
elif 'This live event will begin in a few moments' in f"{error}":
|
# if 'This live event will begin in a few moments' in f"{error}":
|
||||||
self.summary['skipped_videos'] += 1
|
# self.summary['skipped_videos'] += 1
|
||||||
else:
|
self.summary['skipped_videos'] += 1
|
||||||
self.summary['skipped_videos'] += 1
|
self._log.debug(
|
||||||
self._log.debug(
|
"Skipping video. Error: %s",
|
||||||
"Skipping video. Error: %s",
|
error
|
||||||
error
|
)
|
||||||
)
|
|
||||||
return None
|
return None
|
||||||
video_info = ydl.sanitize_info(raw_video_info)
|
video_info = ydl.sanitize_info(raw_video_info)
|
||||||
return video_info
|
return video_info
|
||||||
|
|
Loading…
Reference in a new issue