mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 20:00:15 +00:00
handle error if subscribed channel not available anymore, #175
This commit is contained in:
parent
060f0d575e
commit
b98ccd9dab
@ -48,7 +48,13 @@ class ChannelSubscription:
|
|||||||
}
|
}
|
||||||
if limit:
|
if limit:
|
||||||
obs["playlistend"] = self.channel_size
|
obs["playlistend"] = self.channel_size
|
||||||
|
|
||||||
|
try:
|
||||||
chan = yt_dlp.YoutubeDL(obs).extract_info(url, download=False)
|
chan = yt_dlp.YoutubeDL(obs).extract_info(url, download=False)
|
||||||
|
except yt_dlp.utils.DownloadError:
|
||||||
|
print(f"{channel_id}: failed to extract videos, skipping.")
|
||||||
|
return False
|
||||||
|
|
||||||
last_videos = [(i["id"], i["title"]) for i in chan["entries"]]
|
last_videos = [(i["id"], i["title"]) for i in chan["entries"]]
|
||||||
return last_videos
|
return last_videos
|
||||||
|
|
||||||
@ -66,6 +72,8 @@ class ChannelSubscription:
|
|||||||
for idx, channel in enumerate(all_channels):
|
for idx, channel in enumerate(all_channels):
|
||||||
channel_id = channel["channel_id"]
|
channel_id = channel["channel_id"]
|
||||||
last_videos = self.get_last_youtube_videos(channel_id)
|
last_videos = self.get_last_youtube_videos(channel_id)
|
||||||
|
|
||||||
|
if last_videos:
|
||||||
for video in last_videos:
|
for video in last_videos:
|
||||||
if video[0] not in to_ignore:
|
if video[0] not in to_ignore:
|
||||||
missing_videos.append(video[0])
|
missing_videos.append(video[0])
|
||||||
|
Loading…
Reference in New Issue
Block a user