From 2f51b3821b1e54881189d797fb04d0f2712f5831 Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Sun, 25 Apr 2021 13:02:07 +0200 Subject: [PATCH] Handle video not found gracefully --- twitchdl/commands/download.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/twitchdl/commands/download.py b/twitchdl/commands/download.py index 9c4baab..2ac9a5d 100644 --- a/twitchdl/commands/download.py +++ b/twitchdl/commands/download.py @@ -222,6 +222,9 @@ def _download_video(video_id, args): print_out("Looking up video...") video = twitch.get_video(video_id) + if not video: + raise ConsoleError("Video {} not found".format(video_id)) + print_out("Found: {} by {}".format( video['title'], video['creator']['displayName']))