From 6a0401087a673231cb20d5341b5b08d5b02bfce6 Mon Sep 17 00:00:00 2001 From: mpeter50 <83356418+mpeter50@users.noreply.github.com> Date: Mon, 15 May 2023 13:13:47 +0200 Subject: [PATCH] print twitch gql api errors when extracting chat --- yt_dlp/extractor/twitch.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yt_dlp/extractor/twitch.py b/yt_dlp/extractor/twitch.py index 8a24160a6..a645773eb 100644 --- a/yt_dlp/extractor/twitch.py +++ b/yt_dlp/extractor/twitch.py @@ -581,6 +581,11 @@ def _extract_chat(self, vod_id): # chat_history.clear() break + response_errors = traverse_obj(response, (slice, 'errors')) + + if response_errors is not None and len(response_errors) > 0: + self.report_warning(f"Error response recevied for fetching next chat history fragment: {response_errors}") + comments_obj = traverse_obj(response, (0, 'data', 'video', 'comments')) chat_history.extend(traverse_obj(comments_obj, ('edges', slice, 'node')))