Add new var for errors
This commit is contained in:
parent
386a184f12
commit
ae830321b5
1 changed files with 10 additions and 2 deletions
|
@ -57,6 +57,7 @@ class GetYoutubeVideos:
|
|||
'possible_proxy_errors': 0,
|
||||
'possible_ban_errors': 0,
|
||||
'age_limit_errors': 0,
|
||||
'georestricted_videos': 0,
|
||||
}
|
||||
self.selected_proxy = ''
|
||||
self.proxy_index = 0
|
||||
|
@ -110,6 +111,7 @@ class GetYoutubeVideos:
|
|||
except yt_dlp.utils.DownloadError as error:
|
||||
if 'The uploader has not made this video available in your country' in f"{error}":
|
||||
self.summary['videos_with_error'] += 1
|
||||
self.summary['georestricted_videos'] += 1
|
||||
result = self._change_proxy(video_id)
|
||||
if not result:
|
||||
return None
|
||||
|
@ -192,7 +194,10 @@ class GetYoutubeVideos:
|
|||
)
|
||||
with open(info_filename, 'w', encoding='utf-8') as info_file:
|
||||
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(
|
||||
"Skipping video '%s' as it's a live video",
|
||||
video_info.get('title', '?')
|
||||
|
@ -323,7 +328,10 @@ class GetYoutubeVideos:
|
|||
data['info_dict'].get('channel', '?')
|
||||
)
|
||||
# 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(
|
||||
"Writting download information in to file '%s'",
|
||||
info_filename
|
||||
|
|
Loading…
Reference in a new issue