ignore playlist error in post processing and channel indexing, #1032

This commit is contained in:
Simon 2025-09-03 16:11:28 +07:00
parent 94745c7f84
commit 7bae974aa6
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 25 additions and 6 deletions

View File

@ -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"""

View File

@ -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