Handle video not found gracefully

This commit is contained in:
Ivan Habunek 2021-04-25 13:02:07 +02:00
parent 62092ee25f
commit 2f51b3821b
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95

View File

@ -222,6 +222,9 @@ def _download_video(video_id, args):
print_out("<dim>Looking up video...</dim>")
video = twitch.get_video(video_id)
if not video:
raise ConsoleError("Video {} not found".format(video_id))
print_out("Found: <blue>{}</blue> by <yellow>{}</yellow>".format(
video['title'], video['creator']['displayName']))