From 678bf11a8af9119ac075eba3b3fea64d0351cb60 Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Tue, 10 Nov 2020 10:44:18 +0100 Subject: [PATCH] Fix print_clip when game is not set --- twitchdl/output.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/twitchdl/output.py b/twitchdl/output.py index 76cb7fa..13067a3 100644 --- a/twitchdl/output.py +++ b/twitchdl/output.py @@ -84,13 +84,15 @@ def print_video(video): def print_clip(clip): published_at = clip["createdAt"].replace("T", " @ ").replace("Z", "") length = utils.format_duration(clip["durationSeconds"]) + channel = clip["broadcaster"]["channel"]["displayName"] + playing = ( + "playing {}".format(clip["game"]["name"]) + if clip["game"] else "" + ) print_out("\n{}".format(clip["slug"])) print_out("{}".format(clip["title"])) - print_out("{} playing {}".format( - clip["broadcaster"]["channel"]["displayName"], - clip["game"]["name"] - )) + print_out("{} {}".format(channel, playing)) print_out( "Published {}" " Length: {}"