kernelcoffee / SteamSelfGifter

Bot for steamgifts.com
GNU General Public License v3.0
8 stars 3 forks source link

429 Too Many Requests #10

Closed kernelcoffee closed 3 years ago

kernelcoffee commented 3 years ago

trigger a 429 after a while, seems new.

Dabu-dot commented 3 years ago

Agreed, I thought it was only me because I left it run at night too lmao

MajorLOL commented 3 years ago

Same problem here :(, Btw that last update was great, thanks for your work ;)

Dabu-dot commented 3 years ago

Here are the new values for their Request Rate limits btw:

They explain it's for DDOS prevention but obviously it's against bots aswell lol. New delays between a set of requests should do the trick.

Source

kernelcoffee commented 3 years ago

Awesome, thanks I'm trying to limit as much as I can the amount of request the bot is doing, guess it's not enough. I'll increase the delays for now but now that I read that they seems cool with scripts and bot as long as they don't hammer the server, I'll have the rethink a more smarter bahavior around these rate limits

Dabu-dot commented 3 years ago

Sure, we'll be there if you need testing or infos as well. Some users seems still reluctant about bots and they even discussed about the integration of an API soon to control more the request per user / script linked to SG. As long as SSG won't cause too much loads on the servers, I'm pretty sure it is still safe.

CG (admin of SteamGifts) also has obviously logs of users that reach the error 429 and can see the amount of requests made in a set time. He catched unhumans behaviors on some users in the comments below his post.

As a suggestion, I guess it could be interesting to add a "killswitch" if the bot detect the error 429 and relaunch itself after a time selected by the user in the config.ini

kernelcoffee commented 3 years ago

After investigation I found a bug in a edge case situation, so far I was ignoring games that don't have a reference on steam (either too old, trash game, or publisher removed it) which in most cases doesn't matter.

SG added advertised games that appears at the top of games lists which would get caught in the game list parsing, usually I would catch it because the same game would be parse twice (and hide it), but not if the game doesn't exist on steam (skipped), so the parser would get caught in a endless loop where the list to parse would always return at least one game.

Game not existing on steam are now hidden directly on SG. (so I might be part of the reason why SG started rate limit..)

anyway, I increased the waiting period between request to stay within the limit rate, so should be fixed now.

kernelcoffee commented 3 years ago

I'm keeping the ticket open for now, I'll close it later this week if no issue is reported on this matter.

MajorLOL commented 3 years ago

not having any problems since last update and its even working better then before.

MajorLOL commented 3 years ago

Quick question is there anyway we can change the check time manual? Changing it in the config file would be best.

Would like it to change it to every 2-3 or so

kernelcoffee commented 3 years ago

not currently, since the minimal time range for a giveaway is 1h, the check time is between 16 and 32 minutes (1000/2000 seconds), so it should catch all the giveaways. It doesn't hurt to make it configurable, I'll add it to the todo list.

kernelcoffee commented 3 years ago

It's been a few days, there doesn't seem to be any problems anymore, closing this issue