subzeroid / instagrapi

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

[BUG] Unable to login [macOS] #1626

Open talhakabakus opened 1 year ago

talhakabakus commented 1 year ago

Try Instagrapi SaaS with a free trial https://hikerapi.com/p/5GBWznd3

Describe the bug As the title is self-descriptive, I'm not able to login via my username & password.

To Reproduce

api = Client()
api.login(ACCOUNT_USERNAME, ACCOUNT_PASSWORD)

Traceback

File "/Users/talhakabakus/miniforge3/envs/autoDL/lib/python3.11/site-packages/instagrapi/mixins/private.py", line 360, in _send_private_request
    response.raise_for_status()
  File "/Users/talhakabakus/miniforge3/envs/autoDL/lib/python3.11/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 "/Users/talhakabakus/PycharmProjects/autoDL/run.py", line 26, in <module>
    main()
  File "/Users/talhakabakus/PycharmProjects/autoDL/run.py", line 17, in main
    api.login(ACCOUNT_USERNAME, ACCOUNT_PASSWORD)
  File "/Users/talhakabakus/miniforge3/envs/autoDL/lib/python3.11/site-packages/instagrapi/mixins/auth.py", line 441, in login
    logged = self.private_request("accounts/login/", data, login=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talhakabakus/miniforge3/envs/autoDL/lib/python3.11/site-packages/instagrapi/mixins/private.py", line 542, in private_request
    raise e
  File "/Users/talhakabakus/miniforge3/envs/autoDL/lib/python3.11/site-packages/instagrapi/mixins/private.py", line 527, in private_request
    self._send_private_request(endpoint, **kwargs)
  File "/Users/talhakabakus/miniforge3/envs/autoDL/lib/python3.11/site-packages/instagrapi/mixins/private.py", line 416, in _send_private_request
    raise BadPassword(**last_json)
instagrapi.exceptions.BadPassword: The password you entered is incorrect. Please try again. If you are sure that the password is correct, then change your IP address, because it is added to the blacklist of the Instagram Server

Process finished with exit code 1

Expected behavior Authenticated client as a result of the successful login.

Desktop (please complete the following information):

 - OS: macOS Sonoma (14.0)
 - Python version: 3.11
 - instagrapi version: 2.0.0
AlphaSoftwareInc commented 1 year ago

I have the same error / bug. One thing I noticed is that I also get this error message in instagram when I try to login in my Browser. I know for sure, that the password is correct since I changed it a few minutes ago and copied the password from a password manager.

devmertsert commented 1 year ago

I have the same error. If you find any solution for this please let me know. (It's not just for macOS)

Akif-Efe commented 1 year ago

I'm having the same problem for windows 10. What solution do you suggest? My information is correct but I cannot log in.

EltarieI commented 1 year ago

Same here, I am running it on Ubuntu and it declines all my accounts. I would be more than happy if someone has a solution to share

AlphaSoftwareInc commented 1 year ago

Does not work for me

romanrsr commented 1 year ago

+1

Jasper-Rowan commented 1 year ago

I am having this issue as well.

spacehitchiker commented 1 year ago

@talhakabakus I get that error often, it works for me when I login my instagram profile from the app/web and change my password from settings.

EltarieI commented 1 year ago

@talhakabakus I get that error often, it works for me when I login my instagram profile from the app/web and change my password from settings.

How much time do you have between the errors?

spacehitchiker commented 1 year ago

How much time do you have between the errors?

I usually login once and dump settings into a json file so it stays logged in. (See "Best Practices" in documentation), but I wasn't able to use this api much due to dm sending error, so I can't say much.

nebula0225 commented 1 year ago

try session login

AirFoxer commented 1 year ago

Same here, see #1630 Also MacOS here, any workarounds yet?