2

I'm trying to scrape Instagram using Instaloader library on python, but after several requests, I got this error : TooManyRequestsException: 429 Too Many Requests. I'm a beginner, but would it be possible to use proxy/rotation IP to avoid this exception?

Corentin Moreau
  • 111
  • 1
  • 1
  • 12

1 Answers1

3

I have the same issue, but right now I think that nothing can help. I have used Instaloader for more than a year and I never had any problems. I think that request limit was 200 requests per minute, or something like that.

Now I'm getting the same error after 2 or 3 analyzed posts. It seams that you can send 1 to 5 requests per minute, or something like that. I have tried today from 2 different machines and then my friend tried from his machine (from his house) and he get the same error right away.

Maybe you can try something like this:

user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.8 (KHTML, like Gecko)'
L = instaloader.Instaloader(max_connection_attempts = 5, user_agent = user_agent)

Or if you have a lot of accounts in some list and you are running them in a for loop:

list_of_user_agents = ["agent1", "agent2", "agent3"]
L = instaloader.Instaloader(max_connection_attempts = 5, user_agent = random.choice(list_of_user_agents ))

and also you should add some time dilatations before sending each request:

time.sleep(3)

But, If you want to trick Instagram in not recognizing you...I think its impossible

taga
  • 3,537
  • 13
  • 53
  • 119