Skip to content

[BUG] KeyError: 'profile_def' on search #29

Description

@spurll

Describe the bug
When searching by name or by ID, KeyError: 'profile_dev' occurs

To Reproduce

Python 3.12.3 (main, Jul 31 2024, 17:43:48) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from howlongtobeatpy import HowLongToBeat
>>> HowLongToBeat()
<howlongtobeatpy.HowLongToBeat.HowLongToBeat object at 0x7b827079a5d0>
>>> HowLongToBeat().search("Ogre Battle")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/goodplays/venv/lib/python3.12/site-packages/howlongtobeatpy/HowLongToBeat.py", line 65, in search
    return self.__parse_web_result(game_name, html_result, None, similarity_case_sensitive)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/goodplays/venv/lib/python3.12/site-packages/howlongtobeatpy/HowLongToBeat.py", line 134, in __parse_web_result
    parser.parse_json_result(html_result)
  File "/opt/goodplays/venv/lib/python3.12/site-packages/howlongtobeatpy/JSONResultParser.py", line 40, in parse_json_result
    new_game_entry = self.parse_json_element(game)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/goodplays/venv/lib/python3.12/site-packages/howlongtobeatpy/JSONResultParser.py", line 61, in parse_json_element
    current_entry.profile_dev = input_game_element["profile_dev"]
                                ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'profile_dev'

HLTB API Version
v1.0.7

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions