subzeroid / instagrapi

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

[BUG] While Trying To Login It's Giving Error #658

Closed himanshupphp closed 2 years ago

himanshupphp commented 2 years ago

Bug Description While Trying To Login It's Giving Error

To Reproduce Try login with any account

cl = Client()
cl.login(username, password)

Traceback

Status 429: Too many requests
Ignore 429: Continue login
Traceback (most recent call last):
  File "/Users/sammy/Downloads/scrapper/sam/lib/python3.9/site-packages/instagrapi/mixins/private.py", line 298, in _send_private_request
    response.raise_for_status()
  File "/Users/sammy/Downloads/scrapper/sam/lib/python3.9/site-packages/requests/models.py", line 960, 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/sammy/Downloads/scrapper/scrapper.py", line 141, in <module>
    loginInsta('samphadaa', 'sam@12345')
  File "/Users/sammy/Downloads/scrapper/scrapper.py", line 19, in loginInsta
    cl.login(username, password)
  File "/Users/sammy/Downloads/scrapper/sam/lib/python3.9/site-packages/instagrapi/mixins/auth.py", line 391, in login
    logged = self.private_request("accounts/login/", data, login=True)
  File "/Users/sammy/Downloads/scrapper/sam/lib/python3.9/site-packages/instagrapi/mixins/private.py", line 445, in private_request
    raise e
  File "/Users/sammy/Downloads/scrapper/sam/lib/python3.9/site-packages/instagrapi/mixins/private.py", line 432, in private_request
    self._send_private_request(endpoint, **kwargs)
  File "/Users/sammy/Downloads/scrapper/sam/lib/python3.9/site-packages/instagrapi/mixins/private.py", line 354, in _send_private_request
    raise UnknownError(**last_json)
instagrapi.exceptions.UnknownError: Unknown (ip_block)

Expected behavior

User should be able to login successfully.

Desktop:

adw0rd commented 2 years ago

@himanshupphp Instagram answered you with "ip_block", why did you create a bug?

himanshupphp commented 2 years ago

@himanshupphp Instagram answered you with "ip_block", why did you create a bug?

When I tried to login using credential it was giving this error and then I tried changing my IP It was resolved.