Add option to skip live videos

This commit is contained in:
Antonio J. Delgado 2024-12-10 15:39:15 +02:00
parent 2db39038dd
commit a38392a1a2

View file

@ -101,7 +101,7 @@ class GetYoutubeVideos:
)
with open(info_filename, 'w', encoding='utf-8') as info_file:
json.dump(video_info, info_file, indent=2)
if 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', '?')
@ -344,6 +344,12 @@ class GetYoutubeVideos:
default=False,
help='Create folders per channel and save videos inside their channel folder'
)
@click.option(
'--skip-live-videos', '-S',
is_flag=True,
default=False,
help='Skip live videos'
)
@click_config_file.configuration_option()
def __main__(**kwargs):
return GetYoutubeVideos(**kwargs)