From 96a5cd570b775f07289612c5a6e642c0ceb1c290 Mon Sep 17 00:00:00 2001 From: mpeter50 <83356418+mpeter50@users.noreply.github.com> Date: Sat, 12 Apr 2025 01:54:21 +0200 Subject: [PATCH] formatting changes for ruff --- yt_dlp/extractor/twitch.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yt_dlp/extractor/twitch.py b/yt_dlp/extractor/twitch.py index 7d981f565..1521be127 100644 --- a/yt_dlp/extractor/twitch.py +++ b/yt_dlp/extractor/twitch.py @@ -154,10 +154,10 @@ def _download_base_gql(self, video_id, ops, note, fatal=True): # TODO: remove existence checks when the values will be generated if self._DEVICE_ID: - headers["X-Device-Id"] = self._DEVICE_ID + headers['X-Device-Id'] = self._DEVICE_ID if self._CLIENT_INTEGRITY: - headers["Client-Integrity"] = self._CLIENT_INTEGRITY + headers['Client-Integrity'] = self._CLIENT_INTEGRITY return self._download_json( 'https://gql.twitch.tv/gql', video_id, note, @@ -566,7 +566,7 @@ def _get_subtitles(self, vod_id): pagenum = 1 gql_ops = [{ 'operationName': 'VideoCommentsByOffsetOrCursor', - 'variables': {'videoID': vod_id} + 'variables': {'videoID': vod_id}, # 'variables.cursor': }] @@ -584,7 +584,7 @@ def _get_subtitles(self, vod_id): response_errors = traverse_obj(response, (..., 'errors')) if response_errors: - self.report_warning(f"Error response recevied for fetching next chat history fragment: {response_errors}") + 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', ..., 'node'))) @@ -594,7 +594,7 @@ def _get_subtitles(self, vod_id): if has_more_pages: cursor = traverse_obj(comments_obj, ('edges', 0, 'cursor')) if cursor is None: - self.report_warning("Cannot continue downloading chat history: cursor is missing. There are additional chat pages to download.") + self.report_warning('Cannot continue downloading chat history: cursor is missing. There are additional chat pages to download.') break pagenum += 1 @@ -604,9 +604,9 @@ def _get_subtitles(self, vod_id): cursor = traverse_obj(comments_obj, ('edges', 0, 'cursor')) if cursor is not None: - self.report_warning("Next page indication is missing, but found cursor. Continuing chat history download.") + self.report_warning('Next page indication is missing, but found cursor. Continuing chat history download.') else: # In this case maintenance might be needed. Purpose is to prevent silent errors. - self.report_warning("Next page indication is missing, and cursor not found.") + self.report_warning('Next page indication is missing, and cursor not found.') if not chat_history: return @@ -615,7 +615,7 @@ def _get_subtitles(self, vod_id): return {'rechat': [{ 'data': json.dumps(chat_history), - 'ext': 'twitch-gql-20221228.json' + 'ext': 'twitch-gql-20221228.json', }]} def _real_extract(self, url):