From 782862bce5d3581668663014c4abd3c4506186c2 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 9 Oct 2025 10:07:52 +0700 Subject: [PATCH] raise error on missing published date --- backend/video/src/index.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/video/src/index.py b/backend/video/src/index.py index 533402f6..2aded46f 100644 --- a/backend/video/src/index.py +++ b/backend/video/src/index.py @@ -222,6 +222,10 @@ class YoutubeVideo(YouTubeItem, YoutubeSubtitle): return timestamp upload_date = self.youtube_meta["upload_date"] + if not upload_date: + raise ValueError( + f"Could not extract published date for {self.youtube_id}" + ) upload_date_time = datetime.strptime(upload_date, "%Y%m%d") published = upload_date_time.strftime("%Y-%m-%d")