2

I have written this to upload 10000 photos to Instagram, one each hour and whenever I run it I get these errors

INFO - Instabot version: 0.117.0 Started

INFO - Not yet logged in starting: PRE-LOGIN FLOW!

ERROR - Request returns 429 error!

WARNING - That means 'too many requests'. I'll go to sleep for 5 minutes.

this is my code am I doing anything wrong? Can someone please point it out and explain?

from instabot import Bot import time

bot = Bot()

image = 1

bot.login(username="username", password="password")

while image < 10000: photo = str(image) bot.upload_photo(f"{photo}.png") time.sleep(3600) image += 1

Sticko5757
  • 31
  • 2
  • 5
  • From a Google search of HTTP error code 429: "The HTTP 429 Too Many Requests response status code indicates the user has sent too many requests in a given amount of time ("rate limiting")." – Marcel Nov 29 '21 at 00:35
  • You should add a longer sleep duration, or limit the amount of pictures you send in a given amount of time. – Marcel Nov 29 '21 at 00:36
  • @Marcel I have limited the pictures to 24 and doubled the sleep duration, but still getting the same error – Sticko5757 Nov 29 '21 at 00:41
  • Yeah, your IP is probably being limited. You should wait for a day and then try again, or change your IP somehow. – Marcel Nov 29 '21 at 00:42
  • @Marcel I will try later then, thank you. – Sticko5757 Nov 29 '21 at 00:43

2 Answers2

4

You just need to go to api.py This is a file in this InstaBot library In case if you're using vscode editor then just ctrl+click on the last link shown in error logs in terminal of vscode

Then comment out the complete chunk of code starting from 559 to 585(complete if block) Now you're good to go

-1

I don't see any problem with your code.

Error 429 and what it means: How can I bypass the 429-error from www.instagram.com?

Long story short, you have probably made too many REQUEST, and Instagram is blocking you ( it could be that you tried this code once, without the time.sleep(3600) and resulted 10000 request )

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 29 '21 at 05:46
  • Hi, I am having the same issue but it does not happen after many tials. I simply get it when I just try to login. I am waiting the recommended amount, and cleaning the cookies, however, still U could not manage to login yet once. – Ferda-Ozdemir-Sonmez Mar 17 '22 at 20:17
  • same for me. I only make one request a day (or every second day) and still get this error... – Paulo Caldas May 26 '22 at 08:46
  • is it fixed guys – Mohammed Malek Aug 15 '23 at 18:26