diff --git a/backend/channel/src/index.py b/backend/channel/src/index.py index af240693..37f2e625 100644 --- a/backend/channel/src/index.py +++ b/backend/channel/src/index.py @@ -241,13 +241,21 @@ class YoutubeChannel(YouTubeItem): ] self.task.send_progress(message, progress=(idx + 1) / total) - @staticmethod - def _index_single_playlist(playlist): + def _index_single_playlist(self, playlist): """add single playlist if needed""" from playlist.src.index import YoutubePlaylist - playlist = YoutubePlaylist(playlist[0]) - playlist.update_playlist(skip_on_empty=True) + try: + playlist = YoutubePlaylist(playlist[0]) + playlist.update_playlist(skip_on_empty=True) + except ValueError as err: + message = [ + f"{self.youtube_id}: skip failed playlist import", + str(err), + ] + print(message) + if self.task: + self.task.send_progress(message) def get_channel_videos(self): """get all videos from channel""" diff --git a/backend/download/src/yt_dlp_handler.py b/backend/download/src/yt_dlp_handler.py index 096207b1..2221390d 100644 --- a/backend/download/src/yt_dlp_handler.py +++ b/backend/download/src/yt_dlp_handler.py @@ -386,8 +386,19 @@ class DownloadPostProcess(DownloaderBase): if not playlist_id or not idx or not total: break - playlist = YoutubePlaylist(playlist_id) - playlist.update_playlist(skip_on_empty=True) + try: + playlist = YoutubePlaylist(playlist_id) + playlist.update_playlist(skip_on_empty=True) + except ValueError as err: + message = [ + f"{playlist_id}: skip failed playlist import", + str(err), + ] + print(message) + if self.task: + self.task.send_progress(message) + + continue if not self.task: continue