From b071612038df25cf963d3c4e542e6e578cb18d61 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 10 Feb 2022 17:34:21 +0700 Subject: [PATCH] better error raising for add player info --- tubearchivist/home/src/index/video.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tubearchivist/home/src/index/video.py b/tubearchivist/home/src/index/video.py index 4ac4461..c9c57ce 100644 --- a/tubearchivist/home/src/index/video.py +++ b/tubearchivist/home/src/index/video.py @@ -350,7 +350,7 @@ class YoutubeVideo(YouTubeItem, YoutubeSubtitle): try: # when indexing from download task vid_path = self.build_dl_cache_path() - except FileNotFoundError: + except FileNotFoundError as err: # when reindexing needs to handle title rename channel = os.path.split(self.json_data["media_url"])[0] channel_dir = os.path.join(self.app_conf["videos"], channel) @@ -360,7 +360,7 @@ class YoutubeVideo(YouTubeItem, YoutubeSubtitle): vid_path = os.path.join(channel_dir, file) break else: - raise FileNotFoundError + raise FileNotFoundError("could not find video file") from err duration_handler = DurationConverter() duration = duration_handler.get_sec(vid_path)