sqdnoises / infinite-craft

An API Wrapper of Neal's Infinite Craft game in Python for people to implement in their programs.
https://neal.fun/infinite-craft/
MIT License
8 stars 6 forks source link

403 Forbidden Error while trying to pair using the API #2

Open WiktorProj opened 4 months ago

WiktorProj commented 4 months ago

I was testing out the first example of this, and I got a 403 forbidden error shown below:

2024-06-13 16:00:23.166185 [INFINITE CRAFT] WARN  Resetting discoveries storage JSON file (discoveries.json)
Pairing elements: 💧 Water and 🔥 Fire
2024-06-13 16:00:23.552287 [INFINITE CRAFT] WARN  Closed InfiniteCraft session
Traceback (most recent call last):
  File "c:\Users\[me]\Desktop\coding\infinite-craft.py", line 10, in <module>
    asyncio.run(main())
...
  File "c:\Users\[me]\Desktop\coding\infinite-craft.py", line 7, in main
    result = await game.pair(game.discoveries[0], game.discoveries[1]) # Pair Water and Fire
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\[me]\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\infinitecraft\infinitecraft.py", line 293, in pair
    async with self._session.get(f"/api/infinite-craft/pair", params=params) as response:
...
  File "C:\Users\[me]\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\aiohttp\client_reqrep.py", line 1070, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://neal.fun/api/infinite-craft/pair?first=Water&second=Fire')
WiktorProj commented 4 months ago

now i'm confused because it magicaly fixed everything

sqdnoises commented 4 months ago

might be a user agent issue, let me know if you have this issue again

elouangrimm commented 2 months ago

@sqdnoises I have this same problem with this repo (in which I use this module), do you know how I could fix this?

Here is the main error: aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://neal.fun/api/infinite-craft/pair?first=Crypto+Moon+Elvis&second=Clockwork+Satyr')

sqdnoises commented 2 months ago

Seems to be because of cf verification, I will try to fix this after 2 days

neeoder commented 1 week ago

Same problem for me. Though the link, when opened in the browser, works