xenova / chat-downloader

A simple tool used to retrieve chat messages from livestreams, videos, clips and past broadcasts. No authentication needed!
https://chat-downloader.readthedocs.io/
MIT License
906 stars 127 forks source link

[BUG] KeyError: 'data' #197

Closed Smallinger closed 1 year ago

Smallinger commented 1 year ago

Basic information

Describe the bug

Traceback (most recent call last): File "/usr/local/bin/chat_downloader", line 33, in sys.exit(load_entry_point('chat-downloader==0.2.3', 'console_scripts', 'chat_downloader')()) File "/usr/local/lib/python3.9/dist-packages/chat_downloader-0.2.3-py3.9.egg/chat_downloader/cli.py", line 194, in main run(args.dict) File "/usr/local/lib/python3.9/dist-packages/chat_downloader-0.2.3-py3.9.egg/chat_downloader/chat_downloader.py", line 351, in run chat = downloader.get_chat(chat_params) File "/usr/local/lib/python3.9/dist-packages/chat_downloader-0.2.3-py3.9.egg/chat_downloader/chat_downloader.py", line 224, in get_chat chat = get_chat(match, params) File "/usr/local/lib/python3.9/dist-packages/chat_downloader-0.2.3-py3.9.egg/chat_downloader/sites/twitch.py", line 1653, in _get_chat_by_stream_id return self.get_chat_by_stream_id(match.group('id'), params) File "/usr/local/lib/python3.9/dist-packages/chat_downloader-0.2.3-py3.9.egg/chat_downloader/sites/twitch.py", line 1666, in get_chat_by_stream_id stream_info = self._download_gql(query)[0]['data']['user'] KeyError: 'data'

it was a livestream, there have no vods so i can test it again :/

xenova commented 1 year ago

Hi there. This is actually a bug with Twitch itself. Sometimes it doesn't recognise the query request, so, yesterday I added logic to just retry on error: https://github.com/xenova/chat-downloader/commit/10d8f1fc74a0555f6a50d3353b70ea5a24fb3bce

Let me push it to a new release so you can get it running.

xenova commented 1 year ago

Updating to 0.2.4 should fix this now: pip install --upgrade chat-downloader 👍

Smallinger commented 1 year ago

Thanks i test it and give feedback is it working.

gadi-playstream-gg commented 1 year ago

Unfortnetly I'm still experiencing this error pretty often. I've upgraded to 0.2.4. any idea?

xenova commented 1 year ago

It should automatically retry. Unfortunately this seems to be a twitch issue. Other services like yt-dlp are also facing the same problem: