From 6108b1558773b34b6688217283fa50de6b66a73f Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Tue, 10 Nov 2020 12:40:11 +0100 Subject: [PATCH] Handle channel not found in clips --- twitchdl/twitch.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/twitchdl/twitch.py b/twitchdl/twitch.py index 80a25c4..ef5e3ee 100644 --- a/twitchdl/twitch.py +++ b/twitchdl/twitch.py @@ -153,7 +153,12 @@ def get_channel_clips(channel_id, period, limit, after=None): "period": period.upper(), }) + response = gql_query(query) + user = response["data"]["user"] + if not user: + raise ConsoleError("Channel {} not found".format(channel_id)) + return response["data"]["user"]["clips"]