subzeroid / instagrapi

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

[BUG Issue with Insta posting. #927

Open ghuser9822 opened 2 years ago

ghuser9822 commented 2 years ago

Seems like there is some issue with insta login.

It was working fine. But now throwing issue...

Might be some issue with the headers being used. https://stackoverflow.com/a/35010312

How to resolve this and how much frequency do you suggest per hour /day of login through this?

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/instagrapi/mixins/private.py", line 298, in _send_private_request
    response.raise_for_status()
  File "/usr/local/lib/python3.10/dist-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 "/root/InstaTweetFW/finInsta.py", line 129, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/root/InstaTweetFW/finInsta.py", line 73, in main
    upload_post_photo(jpg_name,captions)
  File "/root/InstaTweetFW/finInsta.py", line 34, in upload_post_photo
    cl.login(IG_USERNAME, IG_PASSWORD)
  File "/usr/local/lib/python3.10/dist-packages/instagrapi/mixins/auth.py", line 391, in login
    logged = self.private_request("accounts/login/", data, login=True)
  File "/usr/local/lib/python3.10/dist-packages/instagrapi/mixins/private.py", line 447, in private_request
    raise e
  File "/usr/local/lib/python3.10/dist-packages/instagrapi/mixins/private.py", line 434, in private_request
    self._send_private_request(endpoint, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/instagrapi/mixins/private.py", line 354, in _send_private_request
    raise UnknownError(**last_json)
instagrapi.exceptions.UnknownError: The username you entered doesn't appear to belong to an account. Please check your username and try again.
88um commented 2 years ago

Use proxies. Its an ip block

khaledhawari commented 1 year ago

@88um getting same issue even though trying to different IPs, any other suggestions you may have?

Traceback (most recent call last): File "/Users/khaledhawari/20221020_saveCollections_v1.5.py", line 140, in save_collections(USER_EMAIL, USER_PASSWORD) File "/Users/khaledhawari/20221020_saveCollections_v1.5.py", line 89, in save_collections loggedInSuccess = cl.login(user_email, user_password) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/instagrapi/mixins/auth.py", line 393, in login logged = self.private_request("accounts/login/", data, login=True) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/instagrapi/mixins/private.py", line 445, in private_request raise e File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/instagrapi/mixins/private.py", line 432, in private_request self._send_private_request(endpoint, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/instagrapi/mixins/private.py", line 354, in sendprivate_request raise UnknownError(last_json) instagrapi.exceptions.UnknownError: The username you entered doesn't appear to belong to an account. Please check your username and try again.

adw0rd commented 1 year ago

@khaledhawari All your IP addresses are already in Instagram's temporary blacklist, change your proxy address provider

khaledhawari commented 1 year ago

@adw0rd thanks for the reply! will give it a go

khaledhawari commented 1 year ago

@adw0rd could Instagram block login attempts detected from its app only?

Im able to login from browser, but through instagram app on my mobile or through script i get the same error

adw0rd commented 1 year ago

@khaledhawari Maybe yes, instagrapi uses the mobile api for the most part

khaledhawari commented 1 year ago

@adw0rd you were right, used VPN and was able to bypass the issue! any news regarding the Status 429: Too many requests issue? Might it be related to why IPs are getting banned?