-
-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Basic information
- Program version: 0.2.8
- Python version: 3.12.3
- Operating system: Ubuntu
Describe the bug
As of a few hours ago (definitely fewer than 24), chat_downloader ceased operating entirely on Twitch, for either live streams or VODs.
Command/Code used
If running from the command line, provide the following:
- The command used (including the verbose tag,
-v):
$ chat_downloader -v https://www.twitch.tv/dashducks
- Output from the above command:
[DEBUG] Python version: 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0]
[DEBUG] Program version: 0.2.8
[DEBUG] Initialisation parameters: {'headers': None, 'cookies': None, 'proxy': None}
[DEBUG] Created TwitchChatDownloader session.
[INFO] Site: twitch.tv
[DEBUG] Program parameters: {'url': 'https://www.twitch.tv/dashducks', 'start_time': None, 'end_time': None, 'max_attempts': 15, 'retry_timeout': None, 'interruptible_retry': True, 'timeout': None, 'inactivity_timeout': None, 'max_messages': None, 'message_groups': ['messages'], 'message_types': None, 'output': None, 'overwrite': True, 'sort_keys': True, 'indent': 4, 'format': 'twitch', 'format_file': None, 'chat_type': 'live', 'ignore': None, 'message_receive_timeout': 0.1, 'buffer_size': 4096}
[DEBUG] Starting new HTTPS connection (1): gql.twitch.tv:443
[DEBUG] https://gql.twitch.tv:443 "POST /gql HTTP/1.1" 200 165
[DEBUG] Session closed.
Traceback (most recent call last):
File "/home/crj/venv-testing/bin/chat_downloader", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/crj/venv-testing/lib/python3.12/site-packages/chat_downloader/cli.py", line 194, in main
run(**args.__dict__)
File "/home/crj/venv-testing/lib/python3.12/site-packages/chat_downloader/chat_downloader.py", line 351, in run
chat = downloader.get_chat(**chat_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/crj/venv-testing/lib/python3.12/site-packages/chat_downloader/chat_downloader.py", line 224, in get_chat
chat = get_chat(match, params)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/crj/venv-testing/lib/python3.12/site-packages/chat_downloader/sites/twitch.py", line 1646, in _get_chat_by_stream_id
return self.get_chat_by_stream_id(match.group('id'), params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/crj/venv-testing/lib/python3.12/site-packages/chat_downloader/sites/twitch.py", line 1659, in get_chat_by_stream_id
stream_info = self._download_gql(query)[0]['data']['user']
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'data'
Otherwise, if using the python module, provide the following:
I'm not including an example because the problem is reproducible via the command line, but I initially observed it via the Python API (with the same exception at the same point in the code).
Expected behavior
I expected the program to retrieve chat messages.
Screenshots
n/a
Additional context/information
I believe this is because Twitch has replaced all of their GQL persistedQuery hashes; yt-dlp and streamlink are also affected.
This means that _OPERATION_HASHES at twitch.py:842 needs updating. I would fix it myself, but I can't see how to determine the replacements.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Projects
Milestone
Relationships
Development
Select code repository
Activity
babupipi commentedon Nov 11, 2025
twitch.py
Line 856
# 'ComscoreStreamingQuery': 'e1edae8122517d013405f237ffcc124515dc6ded82480a88daef69c83b53ac01',
Do this
'ComscoreStreamingQuery': 'e1edae8122517d013405f237ffcc124515dc6ded82480a88daef69c83b53ac01',
and
Line 1652
Do this
gadi-playstream-gg commentedon Nov 11, 2025
having the same issue.
uwu-crj commentedon Nov 11, 2025
Thanks — that seems to fix acquisition from a live stream, but the problem remains for a VOD.
Acting on raw intuition based on the change you suggested for
get_chat_by_stream_idI tried amendingget_chat_by_vod_idto say:…but that didn't work — when I instrumented it to print the GQL response, it read:
[ { "errors": [ { "message": "PersistedQueryNotFound" } ], "extensions": { "durationMilliseconds": 2, "operationName": "VideoMetadata", "requestID": "01K9S9E7XR72CQVP8SRYBJ647D" } }, { "data": {}, "extensions": { "durationMilliseconds": 2, "operationName": "ComscoreStreamingQuery", "requestID": "01K9S9E7XR72CQVP8SRYBJ647D" } }