subzeroid / instagrapi

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

[BUG] IP address blocked #2037

Open 7FULL opened 1 month ago

7FULL commented 1 month ago

Describe the bug I run a very simple code and instagram blocks me

To Reproduce First of all I am in europe, and I didnt get it to work until I activated a VPN

This is my code

from instagrapi import Client as InstagraClient

instaApi = InstagraClient()
time.sleep(10)
instaApi.login(USERNAME, PASSWORD)

Traceback

Traceback (most recent call last):
  File "I:\$$$\GeneradorImagenes\ImageGeneratorBot\bot\.venv\Lib\site-packages\instagrapi\mixins\private.py", line 359, in _send_private_request
    response.raise_for_status()
  File "I:\$$$\GeneradorImagenes\ImageGeneratorBot\bot\.venv\Lib\site-packages\requests\models.py", line 1024, 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 "I:\$$$\GeneradorImagenes\ImageGeneratorBot\bot\app.py", line 517, in <module>
    instaApi.login(USERNAME, PASSWORD)
  File "I:\$$$\GeneradorImagenes\ImageGeneratorBot\bot\.venv\Lib\site-packages\instagrapi\mixins\auth.py", line 441, in login
    logged = self.private_request("accounts/login/", data, login=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "I:\$$$\GeneradorImagenes\ImageGeneratorBot\bot\.venv\Lib\site-packages\instagrapi\mixins\private.py", line 541, in private_request
    raise e
  File "I:\$$$\GeneradorImagenes\ImageGeneratorBot\bot\.venv\Lib\site-packages\instagrapi\mixins\private.py", line 526, in private_request
    self._send_private_request(endpoint, **kwargs)
  File "I:\$$$\GeneradorImagenes\ImageGeneratorBot\bot\.venv\Lib\site-packages\instagrapi\mixins\private.py", line 415, in _send_private_request
    raise BadPassword(**last_json)
instagrapi.exceptions.BadPassword: We can send you an email to help you get back into your account. 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

Expected behavior For it to log me in

Screenshots No need for screenshots

Desktop:

sunmasters commented 1 month ago

Use mobile IP. Or proxy

7FULL commented 1 month ago

Use mobile IP. Or proxy

How can I do that?