Add new var for errors

This commit is contained in:
Antonio J. Delgado 2025-02-23 09:48:22 +02:00
parent 386a184f12
commit ae830321b5

View file

@ -57,6 +57,7 @@ class GetYoutubeVideos:
'possible_proxy_errors': 0, 'possible_proxy_errors': 0,
'possible_ban_errors': 0, 'possible_ban_errors': 0,
'age_limit_errors': 0, 'age_limit_errors': 0,
'georestricted_videos': 0,
} }
self.selected_proxy = '' self.selected_proxy = ''
self.proxy_index = 0 self.proxy_index = 0
@ -110,6 +111,7 @@ class GetYoutubeVideos:
except yt_dlp.utils.DownloadError as error: except yt_dlp.utils.DownloadError as error:
if 'The uploader has not made this video available in your country' in f"{error}": if 'The uploader has not made this video available in your country' in f"{error}":
self.summary['videos_with_error'] += 1 self.summary['videos_with_error'] += 1
self.summary['georestricted_videos'] += 1
result = self._change_proxy(video_id) result = self._change_proxy(video_id)
if not result: if not result:
return None return None
@ -192,7 +194,10 @@ class GetYoutubeVideos:
) )
with open(info_filename, 'w', encoding='utf-8') as info_file: with open(info_filename, 'w', encoding='utf-8') as info_file:
json.dump(video_info, info_file, indent=2) json.dump(video_info, info_file, indent=2)
if self.config['skip_live_videos'] and video_info['live_status'] == 'is_live': if (
self.config['skip_live_videos'] and
video_info['live_status'] == 'is_live'
):
self._log.debug( self._log.debug(
"Skipping video '%s' as it's a live video", "Skipping video '%s' as it's a live video",
video_info.get('title', '?') video_info.get('title', '?')
@ -323,7 +328,10 @@ class GetYoutubeVideos:
data['info_dict'].get('channel', '?') data['info_dict'].get('channel', '?')
) )
# break # break
info_filename = os.path.join(self.config['download_dir'], f"{os.path.basename(data['filename'])}.download_info.json") info_filename = os.path.join(
self.config['download_dir'],
f"{os.path.basename(data['filename'])}.download_info.json"
)
self._log.debug( self._log.debug(
"Writting download information in to file '%s'", "Writting download information in to file '%s'",
info_filename info_filename