403 Forbidden Error while trying to pair using the API
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')
now i'm confused because it magicaly fixed everything
might be a user agent issue, let me know if you have this issue again
@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')
Seems to be because of cf verification, I will try to fix this after 2 days
Same problem for me. Though the link, when opened in the browser, works
Anyone still working on this?
Anyone still working on this?
that's what i wanna know
I'm currently working on a fix, Please stand by as the owner has a heavy workload irl while me being the only contributor also has finals for next week. So please be patient and bare with us as we fix this issue
Same problem for me. Though the link, when opened in the browser, works
it doesn't work in browser for me
I've got a workaround in python by using playwright and launching a chromium instance for every pair, not optimal, but it works :D
Inspo by: https://github.com/ActiveTutorial/ic-proxy
I've got a workaround in python by using playwright and launching a chromium instance for every pair, not optimal, but it works :D
Inspo by: https://github.com/ActiveTutorial/ic-proxy
oh that's really good! i'm currently busy irl, so it would be great if you could make a client and test it out with a lot of requests and then create a pull request!
you can put your client in the infinitecraft/clients directory
you can look at how I implemented the client infinitecraft/clients/aiohttp_client.py, and then make your own
to use your client, you can pass it into the session_cls argument in the InfiniteCraft class like this:
from infinitecraft.clients.your_client import YourClient
# ...
async with InfiniteCraft(session_cls=YourClient) as game: # session_cls=YourClient
result = await game.pair(game.discoveries[0], game.discoveries[1])
print(f"Result: {result}")
you can also import it using
from infinitecraft.clients import YourClient
if you add from .your_client import * into infinitecraft/clients/__init__.py which I would recommend doing
https://neal.fun/api/infinite-craft/pair?ref=app&first=water&second=fire it works for the api I found the url in https://github.com/ActiveTutorial/ic-proxy
I got it working on PowerShell, I will send the script when I got time.
@sqdnoises
@ACrazyPencil that's really great! thanks for the update! I'll try to experiment with the URL you posted tomorrow since it's bedtime for me right now. please do share the working powershell script, it would help a ton!
and the library right now is a mess to me and probably some others (I did not follow PEP 8 standards while working on this project), so I'd be doing that tommorrow aswell
what you do is go to inspect go to the api url copy it as powershell (in network tab) and that how you can get the request and the emoji is mojibake.
my main account is @pizzapi2012
you do realise that when you copy the request as powershell, it copies your cloudflare token which is temporarily provided to you after you verify that you are not a bot and that it expires?
it’s the only way, and why is it not safe?
yeah, the hard part is getting the cloudflare token, since it expires after 30 minutes once cf verifies that the user is a human and there's inactivity for 30 minutes
you would have to manually verify again and put the token in if it expires
my main account is @pizzapi2012
this my main account, we could use https://github.com/LOBYXLYX/Cloudflare-Bypass