Closed bruvv closed 4 years ago
Hey @bruvv,
We did a quick check and this issue looks very darn similar to
This could be a coincidence, but if any of these issues solves your problem then I did a good job :smile:
If not, the maintainers will get to this issue shortly.
Cheers, Your Friendly Neighborhood ProBot
@bruvv One thing you could do is add an argument in the function definition of send_request()
that passes the current sleep_minutes to the recursively called send_request()
.
Something like this:
def send_request( # noqa: C901
self,
endpoint,
post=None,
login=False,
with_signature=True,
headers=None,
extra_sig=None,
sleep_minutes=None,
):
Since the first time that the function is called, sleep_minutes
will most likely be None
. Therefore:
Somewhere Here
if sleep_minutes is None:
sleep_minutes = 0
sleep_minutes = sleep_minutes + 5
In the where the function is recursively called, Recursive Call
return self.send_request(
endpoint,
post,
login,
with_signature,
headers,
extra_sig,
sleep_minutes
)
That is a very good one. I made a PR thanks. https://github.com/instagrambot/instabot/pull/1199
Purpose of your issue?
Describe your issue
When we hit a 429 error because something went to wrong and we got soft banned. A 5 minute sleep will be initiated. After 5 minutes it will be tried again. If we are still soft banned, we have another 5 minutes of sleep. What I want to do but I am unable to make myself is that if a second time this sleep occurs, add 5 minutes to it so the timer creeps up. First time it is 5 minutes, second time it is 10 minutes etc...
I tried to change this line: https://github.com/instagrambot/instabot/blob/master/instabot/api/api.py#L491 To: (added the + sign)
but that didn't work.