subzeroid / instagrapi

πŸ”₯ The fastest and powerful Python library for Instagram Private API 2024
https://hikerapi.com/p/bkXQlaVe
MIT License
4.21k stars 667 forks source link

challenge_required error login to any account on any ip #331

Closed klaytonpaiva closed 3 years ago

klaytonpaiva commented 3 years ago

Describe the bug Any account that logs in, even using another IP or VPN, reports the challenge_required error and asks you to confirm your identity. In accounts where instagrapi was used, I can login and logout by browsing after verifying the account, but when I use the instagrapi login, it accuses challenge_required

To Reproduce from instagrapi import Client

cl = Client() cl.login('username', 'pass')# username e password instagram

user_id = cl.user_id_from_username("adw0rd") medias = cl.user_medias(user_id, 20)

Traceback Traceback (most recent call last): File "C:\Users\Klayton\AppData\Local\Programs\Python\Python39\lib\site-packages\instagrapi\mixins\private.py", line 255, in _send_private_request response.raise_for_status() File "C:\Users\Klayton\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 943, 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:\Users\Klayton\AppData\Local\Programs\Python\Python39\lib\site-packages\instagrapi\mixins\private.py", line 385, in private_request self._send_private_request(endpoint, kwargs) File "C:\Users\Klayton\AppData\Local\Programs\Python\Python39\lib\site-packages\instagrapi\mixins\private.py", line 285, in _send_private_request raise ChallengeRequired(last_json) instagrapi.exceptions.ChallengeRequired: challenge_required

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Klayton\AppData\Local\Programs\Python\Python39\lib\site-packages\instagrapi\mixins\private.py", line 255, in _send_private_request response.raise_for_status() File "C:\Users\Klayton\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 943, 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:\Users\Klayton\Desktop\Bot\BotInstagram\BotInstaMont\exemplo_login.py", line 4, in cl.login('felipealvespereira29', '7ZTUEZtklmKz') File "C:\Users\Klayton\AppData\Local\Programs\Python\Python39\lib\site-packages\instagrapi\mixins\auth.py", line 383, in login logged = self.private_request("accounts/login/", data, login=True) File "C:\Users\Klayton\AppData\Local\Programs\Python\Python39\lib\site-packages\instagrapi\mixins\private.py", line 402, in private_request return self._send_private_request(endpoint, kwargs) File "C:\Users\Klayton\AppData\Local\Programs\Python\Python39\lib\site-packages\instagrapi\mixins\private.py", line 285, in _send_private_request raise ChallengeRequired(last_json) instagrapi.exceptions.ChallengeRequired: challenge_required

Expected behavior Until 12/08/2021 it worked normally.

Screenshots echallenge_required 1 echallenge_required 2

Desktop (please complete the following information):

Additional context I've updated instagrapi, I've already looked for help to solve it but I couldn't.

NOTE: Using Google translator.

Jammy108 commented 3 years ago

Also getting this, a loop of endless challenge_required errors.

New-dev0 commented 3 years ago

Same for me πŸ™

elmissouri16 commented 3 years ago

similar situation for me to accounts start getting challenge required lot even if change proxies while back was fine but recently start happening lot

adw0rd commented 3 years ago

Fixed in 1.9.18

New-dev0 commented 3 years ago

Thanks adw0rd πŸ₯³ πŸ‘