Open h4ng3r opened 1 year ago
I'm getting an error when issuing "hashtag_info", seems to be related:
ChallengeResolve: Unknown step_name "submit_phone" for "factsaboutus022" in challenge resolver: {'step_name': 'submit_phone', 'step_data': {'phone_number': 'None'}, 'flow_render_type': 3, 'bloks_action': 'com.instagram.challenge.navigation.take_challenge', 'cni': 17845117700910164, 'challenge_context': '{"step_name": "submit_phone", "cni": 17845117700910164, "is_stateless": false, "challenge_type_enum": "SMS", "present_as_modal": false}', 'challenge_type_enum_str': 'SMS', 'status': 'ok'}
Having exactly the same issue as in the original post, any resolution?
@jstchw we are waiting for a decision from the community, you can help the project and send me a PR
same for me don't work How to call ChallengeChoice ?
@nebula0225 what do you mean? Please provide examples of usage
@adw0rd
I have a account that need have to solve challenge When i try login using that didn't go "challenge_code_handler" It just throw error "challenge_required"
def challenge_code_handler():
# challenge my code
return
cl = ig.Client()
cl.challenge_code_handler = challenge_code_handler
cl.login(USERNAME, PASSWORD)
@nebula0225 so what's the question? So that you don't define parameters, according to the documentation?
https://adw0rd.github.io/instagrapi/usage-guide/challenge_resolver.html
@adw0rd No, The code above is just an example In fact, I worked by referring to that document. I think there are accounts where the challenge doesn't work. The account I tried did not have email and SMS information registered.
if login to web I saw warning and next input box for register email
If you reproduce this issue, then you can send your fixes in the form of a PR, or give me access to the instagram account username, password, proxy and mail access to get the code from isntagram.
Without this, I can't reproduce the problem.
My accounts work fine with the current challenge resolver
Hey Guys,
I am facing the same Issue, but I have some new information.
When I try to do the challenge resolve stuff with a little test script
from instagrapi import Client
IG_USERNAME = "username..."
IG_PASSWORD = 'pass...'
def get_code_from_email(username):
return input("Code lol:")
def get_code_from_sms(username):
return input("Code lol:")
def challenge_code_handler(username, choice):
if choice == ChallengeChoice.SMS:
return get_code_from_sms(username)
elif choice == ChallengeChoice.EMAIL:
return get_code_from_email(username)
return False
cl = Client()
cl.challenge_code_handler = challenge_code_handler
cl.login(IG_USERNAME, IG_PASSWORD)
the SMS code actually shows up on my phone. Seems like the API request for the challenge is working, but at some point there is an issue.
I think, the Issue is here:
Traceback (most recent call last): File "/home/asuna/PycharmProjects/Osintgram2/venv/lib/python3.11/site-packages/instagrapi/mixins/private.py", line 360, in _send_private_request response.raise_for_status() File "/home/asuna/PycharmProjects/Osintgram2/venv/lib/python3.11/site-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/
because when I go to this URL, I get a HTTP 405 Error.
If you need my account credentials to reproduce the error, I can send them to you. I tested the script on 2 Accounts.
Hope that helps a little bit.
Thanks :)
Describe the bug
I implemented the challenge following the example:
But the "challenge_code_handler" is not being called and I'm getting a ChallengeRequired exception.
To Reproduce Just run the example code with an account that requires email challenge.
Traceback
Expected behavior According to documentation and the example the "challenge_code_handler" function should be called when IG requests a challenge.
Desktop (please complete the following information):
Thanks,