From 79d994e460c0d6cb22c196d3d8eea7b0424ffd8a Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 29 Oct 2025 19:01:56 +0700 Subject: [PATCH] handle embed error --- backend/video/src/index.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/video/src/index.py b/backend/video/src/index.py index e33ba37c..0dbb2aae 100644 --- a/backend/video/src/index.py +++ b/backend/video/src/index.py @@ -431,9 +431,16 @@ class YoutubeVideo(YouTubeItem, YoutubeSubtitle): if not self.json_data: self.get_from_es() + if not self.json_data: + print(f"{self.youtube_id}: skip embed, video not indexed") + return + video_base = EnvironmentSettings.MEDIA_DIR media_url = self.json_data.get("media_url") file_path = os.path.join(video_base, media_url) + if not os.path.exists(file_path): + print(f"{self.youtube_id}: skip embed, file not found") + return title = self.json_data["title"] artist = self.json_data["channel"]["channel_name"]