akinator.py icon indicating copy to clipboard operation
akinator.py copied to clipboard

Encountered an error while using aki. start_game

Open Container-Zero opened this issue 10 months ago • 9 comments

Summary

Encountered an error while using aki. start_game

Reproduction Steps

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.9/dist-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
  File "/app/app.py", line 48, in handle_request
    q = await aki.start_game(language=lang)
  File "/usr/local/lib/python3.9/dist-packages/akinator/async_aki/async_akinator.py", line 168, in start_game
    region_info = await self._auto_get_region(get_lang_and_theme(language)["lang"], get_lang_and_theme(language)["theme"])
  File "/usr/local/lib/python3.9/dist-packages/akinator/async_aki/async_akinator.py", line 114, in _auto_get_region
    parsed = json.loads(match.group().split("'arrUrlThemesToPlay', ")[-1])
AttributeError: 'NoneType' object has no attribute 'group'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f819fc90670>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f819fa81a60>, 5245086.969)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f819fc905e0>

Minimal Reproducible Code

The problem can be reproduced 100% by only allowing the code in [ examples/async_aki.py ] to be run.
I'm pretty sure that the first time this error would have occurred would have been within five minutes before UTC/GMT: 2024-04-02 06:10:00 , and I think it's likely that akinator officially, probably at 6:00, changed something.

Expected Results

No errors

Actual Results

An error has occurred

System Information

Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-28-generic x86_64)

Checklist

  • [X] I have searched open issues for duplicates.
  • [X] I have shown the entire traceback, if possible.
  • [X] I have made sure that this issue is valid.

Additional Context

No response

Container-Zero avatar Apr 02 '24 07:04 Container-Zero