isaackogan / TikTokLive

Python library to receive live stream events (comments, gifts, etc.) in realtime from TikTok LIVE.
https://isaackogan.github.io/TikTokLive/
MIT License
752 stars 154 forks source link

TypeError: string indices must be integers, not 'str' #214

Open haphy opened 1 month ago

haphy commented 1 month ago

Describe the bug

input not existed user, error msg is unreasonable

client.run() File "/tk/.venv/lib/python3.11/site-packages/TikTokLive/client/client.py", line 200, in run return self._asyncio_loop.run_until_complete(self.connect(kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/tk/.venv/lib/python3.11/site-packages/TikTokLive/client/client.py", line 176, in connect task: Task = await self.start(kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tk/.venv/lib/python3.11/site-packages/TikTokLive/client/client.py", line 127, in start if fetch_live_check and not await self._web.fetch_is_live(room_id=self._room_id): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tk/.venv/lib/python3.11/site-packages/TikTokLive/client/web/routes/fetch_is_live.py", line 47, in call return (await self.fetch_is_live_room_ids(room_id))[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tk/.venv/lib/python3.11/site-packages/TikTokLive/client/web/routes/fetch_is_live.py", line 66, in fetch_is_live_room_ids return [i["alive"] for i in response_json["data"]] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tk/.venv/lib/python3.11/site-packages/TikTokLive/client/web/routes/fetch_is_live.py", line 66, in return [i["alive"] for i in response_json["data"]] ~^^^^^^^^^ TypeError: string indices must be integers, not 'str'

Package Version v6.0.4

EinGuterWaran commented 3 weeks ago

Any solution for it?