1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-28 01:18:30 +00:00

twitch: fix traversing objects

This commit is contained in:
mpeter50 2023-07-13 20:43:01 +02:00
parent 6a0401087a
commit f0a195cdca

View File

@ -581,13 +581,12 @@ def _extract_chat(self, vod_id):
# chat_history.clear()
break
response_errors = traverse_obj(response, (slice, 'errors'))
response_errors = traverse_obj(response, (..., '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')))
chat_history.extend(traverse_obj(comments_obj, ('edges', ..., 'node')))
has_more_pages = traverse_obj(comments_obj, ('pageInfo', 'hasNextPage'))