From 82a91308f518a0e2f064e78d29b6d6c54a32bd25 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 15 Sep 2021 17:13:10 +0700 Subject: [PATCH] raise ValueError if vid metatdata extraction failes for new videos --- tubearchivist/home/src/index.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tubearchivist/home/src/index.py b/tubearchivist/home/src/index.py index a4baeff..ad35bb4 100644 --- a/tubearchivist/home/src/index.py +++ b/tubearchivist/home/src/index.py @@ -375,6 +375,9 @@ class YoutubeVideo: def index_new_video(youtube_id, missing_vid=False): """ combine video and channel classes for new video index """ vid_handler = YoutubeVideo(youtube_id) + if not vid_handler.vid_dict: + raise ValueError('failed to get metadata for ' + youtube_id) + channel_handler = YoutubeChannel(vid_handler.channel_id) # add filepath to vid_dict channel_name = channel_handler.channel_dict['channel_name']