Closed mvx20 closed 1 year ago
Error info update
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 270, in _send_private_request
response.raise_for_status()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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 "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/instagrapi/mixins/auth.py", line 387, in login
logged = self.private_request("accounts/login/", data, login=True)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 415, in private_request
raise e
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 402, in private_request
self._send_private_request(endpoint, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 320, in _send_private_request
raise TwoFactorRequired(**last_json)
instagrapi.exceptions.TwoFactorRequired: Two-factor authentication required
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 270, in _send_private_request
response.raise_for_status()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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/two_factor_login/
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/user/PycharmProjects/MVRL/zoneSocial/pyot.py", line 9, in <module>
cli.login(username="USERNAME",password="PASSWORD",verification_code=str(str(code)))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/instagrapi/mixins/auth.py", line 409, in login
logged = self.private_request("accounts/two_factor_login/", data, login=True)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 415, in private_request
raise e
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 402, in private_request
self._send_private_request(endpoint, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 326, in _send_private_request
raise UnknownError(**last_json)
instagrapi.exceptions.UnknownError: This code is no longer valid. Please request a new one.
Describe the bug "login_required" error against two factor authentication
To Reproduce
Traceback
Expected behavior seamless login
Desktop (please complete the following information):
Additional context I'm sorry for my bad english