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

instagrapi.exceptions.ChallengeUnknownStep #451

Open ItzmeSwapy opened 2 years ago

ItzmeSwapy commented 2 years ago

Untitled

When I uploaded a single image, I got this error. instagrapi.exceptions.PhotoNotUpload: Unknown ({'message': '', 'response': <Response [302]>})

If I take any other action, it's not possible without resolving this. File "D:\Mind\Automation\RD\env\lib\site-packages\instagrapi\mixins\challenge.py", line 420, in challenge_resolve_simple raise Exception(f'ChallengeResolve: Unknown step_name "{step_name}" for "{self.username}" in challenge resolver: {self.last_json}') Exception: ChallengeResolve: Unknown step_name "escalation_challenge_informational" for "jeffleexc88@mail.com.tr" in challenge resolver: {'step_name': 'escalation_challenge_informational', 'step_data': {'choice': 0, 'community_guideline_body': ['• You have posted content too many times.', '• You have a blocked link in your post.'], 'community_guideline_header': 'We remove content when:', 'responsible_content': {'entity_id': 2708648313323926300, 'content_type': 'post', 'taken_at': 1637116062, 'deleted_content_preview': 'https://instagram.fpnq7-4.fna.fbcdn.net/v/t51.2885-15/e35/s150x150/257999850_160854906220787_4167886110295462478_n.jpg?_nc_ht=instagram.fpnq7-4.fna.fbcdn.net&_nc_cat=111&_nc_ohc=pgBVtDhJEzUAX_Ez6de&edm=AMwhvZcBAAAA&ccb=7-4&oh=edd0662aab9a502d399b3dd6f563f37d&oe=619C0389&_nc_sid=a3358c&ig_cache_key=MjcwODY0ODMxMzMyMzkyNjMwMA%3D%3D.2-ccb7-4', 'takedown_type': 0, 'violation_type': 131, 'violation_text': '', 'content_type_text': 'post'}, 'is_appealable': False, 'strike_level': 0, 'violation_content_group': 'content spam', 'entry_point': 'challenge', 'gain_frameing_content': False, 'system_id': 132947280075456}, 'flow_render_type': 3, 'bloks_action': 'com.instagram.challenge.navigation.take_challenge', 'cni': 17845747274682485, 'challenge_context': '{"step_name": "escalation_challenge_informational", "cni": 17845747274682485, "is_stateless": false, "challenge_type_enum": "ESCALATION"}', 'challenge_type_enum_str': 'ESCALATION', 'status': 'ok'}

How to handle this ?

Originally posted by @ItzmeSwapy in https://github.com/adw0rd/instagrapi/discussions/450

adw0rd commented 2 years ago

The solution to such a challenge has not been implemented, you can help the project implement the processing of this challenge

klaytonpaiva commented 2 years ago

Temporary solution using selenium: After posting the image:

com.photo upload(file, caption =contents_feed)

You test if Instagram blocked it:

driver.find_element_by_xpath('//button[text()="OK"]').click()

if blocked, click OK and go back to your Loop.

           try:
                driver.find_element_by_xpath('//button[text()="OK"]').click()  
                print('[BLOQUEIO] O Instagram bloqueou esta foto.\n')
                print('Pulando esta imagem.\n')
                sleep(3)
                driver.refresh()
            except:
                pass 

            try:
                cl.photo_upload(file, caption =contents_feed)
                print( Feed Postado.\n")   
                sleep(random.randint(5, 10))
            except Exception as e:
                print(e)
ItzmeSwapy commented 2 years ago

instagrapi.exceptions.ChallengeUnknownStep: ChallengeResolve: Unknown step_name "escalation_challenge_informational" for "MYACCOUNTNAME" in challenge resolver: {'step_name': 'escalation_challenge_informational', 'step_data': {'choice': 0, 'community_guideline_body': ['• You have posted content too many times.', '• You have a blocked link in your post.'], 'community_guideline_header': 'We remove content when:', 'responsible_content': {'entity_id': 2768516980444887890, 'content_type': 'post', 'taken_at': 1644252986, 'deleted_content_preview': 'CONTENTLINK', 'takedown_type': 0, 'violation_type': '131', 'violation_text': '', 'content_type_text': 'post'}, 'is_appealable': False, 'strike_level': 0, 'violation_content_group': 'content spam', 'entry_point': 'challenge', 'system_id': 132947280075456}, 'flow_render_type': 3, 'bloks_action': 'com.instagram.challenge.navigation.take_challenge', 'cni': 17854501034704599, 'challenge_context': '{"step_name": "escalation_challenge_informational", "cni": 17854501034704599, "is_stateless": false, "challenge_type_enum": "ESCALATION"}', 'challenge_type_enum_str': 'ESCALATION', 'status': 'ok'}

This is an escalation Challenge happens because of the same reason. If previously any post was taken down by instagram then unless this challenge isn't manually accepted it won't work

inchargeads commented 1 year ago

The solution to such a challenge has not been implemented, you can help the project implement the processing of this challenge

@adw0rd Found this thread from a couple years ago. I'll toss you some $$ if you can solve it, as I am getting it too

008 commented 1 year ago

@inchargeads im work on this right now, you can contact me via @redbrain.art Insta for details.

inchargeads commented 1 year ago

@008 Hey that would be sweet, I think it's actually pretty simple as far as they go, basically just need to send a request to hit an okay button, it's been on my todo list but if you add that request in that would be sweet