JodelRaccoons / jodel_api

Unoffical Python Interface to the Jodel API
https://github.com/nborrmann/jodel_api
MIT License
18 stars 7 forks source link

Disconnecting if running longer #4

Closed M6D6M6A closed 4 years ago

M6D6M6A commented 4 years ago

I wrote a script that gets the post details of a given post every second. It works most of the time well but sometimes i get following error: Error: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

If you dont have a solution ill write a recurson loop to restart a new session and then go on, but would be cleaner without.

Unbrick commented 4 years ago

I guess thats related to rate limiting, try using proxy's when making that many requests.

M6D6M6A commented 4 years ago

Thought so, but if i do a recursiv funktion like this:

    def set_save_location(self, _post_id, point):
        try:
            self.j.set_location(point["lat"], point["lng"], self.jodel_account["city"], country=None, name=None)
        except Exception as e:
            print(f"Error: {e}")
            self.j = jodel_api.JodelAccount(lat=self.jodel_account["lat"], lng=self.jodel_account["lng"], city=self.jodel_account["city"],
                            access_token=self.jodel_account["access_token"], expiration_date=self.jodel_account["expiration_date"],
                            refresh_token=self.jodel_account["refresh_token"], distinct_id=self.jodel_account["distinct_id"],
                            device_uid=self.jodel_account["device_uid"], is_legacy=True)
            self.set_save_location(_post_id, point)

instead of normally calling the function works fine, if i would be ratelimited i would expect a 403 "Access Denied"?

Unbrick commented 4 years ago

As far as I know (also got a few bots running) they enhanced the rate limiting due to ddos attacks. When making to many requests the ddos protection kicks in and just denies the requests

M6D6M6A commented 4 years ago

ok, will just double the wait time between two requests