Add config

This commit is contained in:
Antonio J. Delgado 2024-12-12 15:30:48 +02:00
parent 2f6e70ec32
commit 77c433a381

View file

@ -34,12 +34,6 @@ class GetYoutubeVideos:
('min', 60),
('sec', 1)
)
self.summary = {
'entries_count': 0,
'skipped_videos': 0,
'downloaded_videos': 0,
'error_videos': 0,
}
self.config = kwargs
if 'log_file' not in kwargs or kwargs['log_file'] is None:
self.config['log_file'] = os.path.join(
@ -54,6 +48,13 @@ class GetYoutubeVideos:
'get_youtube_videos.log'
)
self._init_log()
self.summary = {
'config': self.config,
'entries_count': 0,
'skipped_videos': 0,
'downloaded_videos': 0,
'error_videos': 0,
}
if os.path.exists(self.config['downloaded_database']):
with open(self.config['downloaded_database'], 'r', encoding='utf-8') as db_file:
self.downloaded_items = db_file.read().split('\n')