diff --git a/SaveMyPlaylist.py b/SaveMyPlaylist.py index 0e3304e3dbf44a50f860adde771fc5966192c660..40c64ece1a592a62b271deb8a053a7f1ba4dadac 100644 --- a/SaveMyPlaylist.py +++ b/SaveMyPlaylist.py @@ -149,7 +149,6 @@ class SaveMyPlaylist: try: logger.info('Downloading {}/{}: "{}"'.format(idx + 1, len(self._items), fileName)) - newVideos.append(item) ydl_opts = { 'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]', @@ -164,6 +163,8 @@ class SaveMyPlaylist: with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(['https://www.youtube.com/watch?v={}'.format(item[self.VIDEO_ID])]) + + newVideos.append(item) except Exception as e: logger.error(f'Error while downloading video "{fileName}" with ID: "{item[self.VIDEO_ID]}"', exc_info=e)