Skip to content
Snippets Groups Projects
Commit fd6885ad authored by Robert Goldmann's avatar Robert Goldmann
Browse files

append video to newVideos list after downloading successfully

parent 5533a2c8
No related branches found
No related tags found
No related merge requests found
...@@ -149,7 +149,6 @@ class SaveMyPlaylist: ...@@ -149,7 +149,6 @@ class SaveMyPlaylist:
try: try:
logger.info('Downloading {}/{}: "{}"'.format(idx + 1, len(self._items), fileName)) logger.info('Downloading {}/{}: "{}"'.format(idx + 1, len(self._items), fileName))
newVideos.append(item)
ydl_opts = { ydl_opts = {
'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]', 'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]',
...@@ -164,6 +163,8 @@ class SaveMyPlaylist: ...@@ -164,6 +163,8 @@ class SaveMyPlaylist:
with youtube_dl.YoutubeDL(ydl_opts) as ydl: with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download(['https://www.youtube.com/watch?v={}'.format(item[self.VIDEO_ID])]) ydl.download(['https://www.youtube.com/watch?v={}'.format(item[self.VIDEO_ID])])
newVideos.append(item)
except Exception as e: except Exception as e:
logger.error(f'Error while downloading video "{fileName}" with ID: "{item[self.VIDEO_ID]}"', exc_info=e) logger.error(f'Error while downloading video "{fileName}" with ID: "{item[self.VIDEO_ID]}"', exc_info=e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment