raise ValueError if vid metatdata extraction failes for new videos

This commit is contained in:
simon 2021-09-15 17:13:10 +07:00
parent 193e6f91ac
commit 82a91308f5
1 changed files with 3 additions and 0 deletions

View File

@ -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']