subzeroid / instagrapi

🔥 The fastest and powerful Python library for Instagram Private API 2024
https://hikerapi.com/p/bkXQlaVe
MIT License
4.38k stars 686 forks source link

[BUG] Can't login #606

Closed 2hexed closed 2 years ago

2hexed commented 2 years ago

Describe the bug Hi so, I keep getting this error again and again when I try to login with my credentials, at first when I got this error I waited for almost like 4 hrs then tried logging in again with my same code but it gave me the same error again.

Traceback

Status 429: Too many requests
Traceback (most recent call last):
  File "/home/nick/.local/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 298, in _send_private_request
    response.raise_for_status()
  File "/home/nick/.local/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://i.instagram.com/api/v1/accounts/login/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "post.py", line 83, in <module>
    main()
  File "post.py", line 47, in main
    cl.login("userID", "MyPassword")
  File "/home/nick/.local/lib/python3.8/site-packages/instagrapi/mixins/auth.py", line 391, in login
    logged = self.private_request("accounts/login/", data, login=True)
  File "/home/nick/.local/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 445, in private_request
    raise e
  File "/home/nick/.local/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 432, in private_request
    self._send_private_request(endpoint, **kwargs)
  File "/home/nick/.local/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 365, in _send_private_request
    raise PleaseWaitFewMinutes(e, response=e.response, **last_json)
instagrapi.exceptions.PleaseWaitFewMinutes: Please wait a few minutes before you try again.

Expected behavior Login successfully.

Desktop (please complete the following information):

2hexed commented 2 years ago

I tried the solutions given in other issues but nothing worked for me.

maksam07 commented 2 years ago

I almost decided to write about the same problem, but I discovered that the problem is in the proxy. What does the problem have to do with the fact that I'm using the same proxy in the browser and everything is fine in the browser, but if you use this proxy in a script, then the same error occurs there. You should probably look for other proxies...

ShashiTharoor commented 2 years ago

try removing module using pip uninstall instagrapi and reinstall using pip3 install instagrapi

this solved my problem on my ubuntu vps