subzeroid / instagrapi

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

login not working[BUG] #1930

Open MarcoLavoro opened 2 months ago

MarcoLavoro commented 2 months ago

If I try to execute this: `>>> from instagrapi import Client

cl = Client() cl.login(USERNAME, PASSWORD)`

I get this error:

`python prova.py Status 429: Too many requests Ignore 429: Continue login Traceback (most recent call last): File "C:\Users\carlo\AppData\Local\Programs\Python\Python310\lib\site-packages\instagrapi\mixins\private.py", line 302, in _send_private_request response.raise_for_status() File "C:\Users\carlo\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request 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 "C:\OFFLINEPROJECTS\BOTS\UploadInstagram3\prova.py", line 26, in cl.login(ACCOUNT_USERNAME, ACCOUNT_PASSWORD) File "C:\Users\carlo\AppData\Local\Programs\Python\Python310\lib\site-packages\instagrapi\mixins\auth.py", line 390, in login logged = self.private_request("accounts/login/", data, login=True) File "C:\Users\carlo\AppData\Local\Programs\Python\Python310\lib\site-packages\instagrapi\mixins\private.py", line 451, in private_request raise e File "C:\Users\carlo\AppData\Local\Programs\Python\Python310\lib\site-packages\instagrapi\mixins\private.py", line 438, in private_request self._send_private_request(endpoint, kwargs) File "C:\Users\carlo\AppData\Local\Programs\Python\Python310\lib\site-packages\instagrapi\mixins\private.py", line 358, in _send_private_request raise UnknownError(last_json) instagrapi.exceptions.UnknownError: You'll need to update Instagram to the latest version before you can use the app. `

Is this a bug?

ProgrameurGentil commented 1 month ago

Hi, I'm having the same problem. What do I need to do to solve it?

kingbotss commented 2 weeks ago

Bad IP or Proxy. Change it

aboubakrjeb commented 1 week ago

according to the documentation, you can add a delay to mimic the behaviour of a real user: # adds a random delay between 1 and 3 seconds after each request cl.delay_range = [1, 3]

and you can check if the username exists by sending a get request to www.instagram.com/{username} because the login function always return true if the credentials are false!!