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] ChallengeUnknownStep #1462

Closed Yessirskiy closed 1 year ago

Yessirskiy commented 1 year ago

Looks like iIG changed step_name for e-mail verification

Traceback (most recent call last):

File "C:\Users\User\Desktop\insta-bot-main\venv\Lib\site-packages\instagrapi\mixins\private.py", line 360, in _send_private_request response.raise_for_status() │ └ <function Response.raise_for_status at 0x0000029222DE4860> └ <Response [400]> File "C:\Users\User\Desktop\insta-bot-main\venv\Lib\site-packages\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) │ │ └ <Response [400]> │ └ '400 Client Error: Bad Request for url: https://i.instagram.com/api/v1/feed/timeline/' └ <class 'requests.exceptions.HTTPError'>

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://i.instagram.com/api/v1/feed/timeline/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\User\Desktop\insta-bot-main\venv\Lib\site-packages\instagrapi\mixins\private.py", line 520, in private_request self._send_private_request(endpoint, kwargs) │ │ │ └ {'data': '{"feed_view_info": "[]", "phone_id": "6e46cdf8-340e-45ab-af5b-eeef962a1aba", "battery_level": 58, "timezone_offset"... │ │ └ 'feed/timeline/' │ └ <function PrivateRequestMixin._send_private_request at 0x0000029223368540> └ <instagrapi.Client object at 0x0000029225F9D090> File "C:\Users\User\Desktop\insta-bot-main\venv\Lib\site-packages\instagrapi\mixins\private.py", line 391, in _send_private_request raise ChallengeRequired(last_json) │ └ {'message': 'challenge_required', 'challenge': {'url': 'https://i.instagram.com/challenge/?next=/api/v1/feed/timeline/', 'api... └ <class 'instagrapi.exceptions.ChallengeRequired'>

instagrapi.exceptions.ChallengeRequired: challenge_required

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 995, in _bootstrap self._bootstrap_inner() │ └ <function Thread._bootstrap_inner at 0x000002921F631F80> └ <Thread(Thread-48859 (mainLoop), started 9472)> File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner self.run() │ └ <function Thread.run at 0x000002921F631C60> └ <Thread(Thread-48859 (mainLoop), started 9472)> File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run self._target(*self._args, self._kwargs) │ │ │ │ │ └ {} │ │ │ │ └ <Thread(Thread-48859 (mainLoop), started 9472)> │ │ │ └ (Run <374621> (** - *****),) │ │ └ <Thread(Thread-48859 (mainLoop), started 9472)> │ └ <bound method Worker.mainLoop of <instagram.Worker object at 0x000002922409F010>> └ <Thread(Thread-48859 (mainLoop), started 9472)>

File "C:\Users\User\Desktop\insta-bot-main\instagram.py", line 773, in mainLoop self.client.get_timeline_feed() │ │ └ <function PostLoginFlowMixin.get_timeline_feed at 0x00000292230BC4A0> │ └ <instagrapi.Client object at 0x0000029225F9D090> └ <instagram.Worker object at 0x000002922409F010>

File "C:\Users\User\Desktop\insta-bot-main\venv\Lib\site-packages\instagrapi\mixins\auth.py", line 218, in get_timeline_feed return self.private_request( │ └ <function PrivateRequestMixin.private_request at 0x0000029223368680> └ <instagrapi.Client object at 0x0000029225F9D090> File "C:\Users\User\Desktop\insta-bot-main\venv\Lib\site-packages\instagrapi\mixins\private.py", line 533, in private_request self.challenge_resolve(self.last_json) │ │ │ └ {'step_name': 'verify_email_code', 'step_data': {'security_code': 'None', 'resend_delay': 60, 'contact_point': 'n***y@gma... │ │ └ <instagrapi.Client object at 0x0000029225F9D090> │ └ <function ChallengeResolveMixin.challenge_resolve at 0x00000292230BDD00> └ <instagrapi.Client object at 0x0000029225F9D090> File "C:\Users\User\Desktop\insta-bot-main\venv\Lib\site-packages\instagrapi\mixins\challenge.py", line 80, in challenge_resolve return self.challenge_resolve_simple(challenge_url) │ │ └ '/challenge/' │ └ <function ChallengeResolveMixin.challenge_resolve_simple at 0x00000292230BDF80> └ <instagrapi.Client object at 0x0000029225F9D090> File "C:\Users\User\Desktop\insta-bot-main\venv\Lib\site-packages\instagrapi\mixins\challenge.py", line 513, in challenge_resolve_simple raise ChallengeUnknownStep( └ <class 'instagrapi.exceptions.ChallengeUnknownStep'>

instagrapi.exceptions.ChallengeUnknownStep: ChallengeResolve: Unknown step_name "verify_email_code" for "*******" in challenge resolver: {'step_name': 'verify_email_code', 'step_data': {'security_code': 'None', 'resend_delay': 60, 'contact_point': 'n*******y@gmail.com', 'form_type': 'email', 'hide_back_to_login': True, 'choice': 1}, 'flow_render_type': 3, 'bloks_action': 'com.instagram.challenge.navigation.take_challenge', 'cni': 18377931688013699, 'challenge_context': '{"step_name": "verify_email_code", "cni": 18377931688013699, "is_stateless": false, "challenge_type_enum": "HACKED_LOCK", "present_as_modal": false}', 'challenge_type_enum_str': 'HACKED_LOCK', 'status': 'ok'}

adw0rd commented 1 year ago

@Yessirskiy thank you!