From 7bae974aa69ddf3d64d2802bacfa06621ec27bd3 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 3 Sep 2025 16:11:28 +0700 Subject: [PATCH] ignore playlist error in post processing and channel indexing, #1032 --- backend/channel/src/index.py | 16 ++++++++++++---- backend/download/src/yt_dlp_handler.py | 15 +++++++++++++-- 2 files changed, 25 insertions(+), 6 deletions(-) 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