Tried the simple instructions for getting started and the .game(...)
method always fails.
>>> from curseforge import CurseClient
>>> from dotenv import dotenv_values
>>> config = dotenv_values()
>>>
>>> curse = CurseClient(config['CURSEFORGE_API_KEY'])
>>>
>>> curse.game(432)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Work\Gms\CurseForgeAPI\.venv\Lib\site-packages\curseforge\base.py", line 79, in game
return CurseGame.from_dict(self.fetch(f"game/{game_id}"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Work\Gms\CurseForgeAPI\.venv\Lib\site-packages\curseforge\classes\cursegame.py", line 23, in from_dict
id=data.get("id"),
^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
>>>
>>> next(curse.games())
CurseGame(id=78135, name='Demeo', slug='demeo', assets=CurseGameAssets(icon_url='iconUrl', tile_url='tileUrl', cover_url='coverUrl'), status=6, api_status=None, date_modified=None)
Tried a number of game IDs, both with and without caching just in case. No luck.
As you can see the .games()
call after it works, so the API key is working.