gerbenjacobs / HabboAPI

A PHP wrapper for the (undocumented) Habbo API
MIT License
44 stars 10 forks source link

DOSArrest is blocking API calls to Habbo.nl #46

Closed ghost closed 5 years ago

ghost commented 5 years ago

This issue first occured when putting my fansite out there and it threw a HTTP 500 error when calling the Habbo API. Upon further investigation, it turned out DOSArrest is blocking my requests with a HTTP 403 error.

My question is: How do I fix this? I think it's got something to do with cookies. Thanks in advance.

gerbenjacobs commented 5 years ago

Hmm, I've seen this before and I used a cookie hack to circumvent it before. I removed that part of the code in this commit: https://github.com/gerbenjacobs/HabboAPI/commit/d3702ba51be69800509dd3cbb6a725de3a31d654

However, I removed it because it didn't matter anymore for me and it still doesn't. It still works. I'll see if I can test this out later.

I see you have this for NL, I've never had a problem there. It could also be that your hosting providers IP ranges are banned from Habbo (and or DOSArrest). I'm not sure how that last one truly works.

ghost commented 5 years ago

Thanks for the reply. I'm using a pretty reliable host, so I don't see why it should be banned in the first place. I tried contacting the Habbo customer support about four days ago but they didn't reply.

Let me know how things work out from your end, and thank you for making this useful wrapper!

ghost commented 5 years ago

Here's an update. Habbo Support just replied and pointed out they do have an API, but that it's not accessible to the users.

I've never heard of this before. How are all these fansites able to connect to the API, if Habbo says it's not for the users? This concludes my update...

EDIT: I just found this: https://www.habbo.nl/robots.txt Looks like they are actively disallowing any API calls

gerbenjacobs commented 5 years ago

It's because it's not an official API. It's the public-facing API they use for their own site. We are just piggyback riding on top of it.

The HabboAPI does not adhere to the robots.txt file. And I've tested locally from my machine, it works for .nl for me. I've also made a testing page and deployed it to Heroku: https://habbo-api-nl.herokuapp.com/?habbo=Filomiena

I still think it might be related to your provider, certainly since you (and I assume that's what you mean) tested it fine locally during development.

ghost commented 5 years ago

Hmm, I guess I'm just unlucky with picking my provider then. Do you have any experience with providers that are not blocked from DOSAgent?