Skip to content

Commit

Permalink
update challange.py
Browse files Browse the repository at this point in the history
- add a code parameter in a challenge_code_handler
  • Loading branch information
Jmallone authored Mar 16, 2022
1 parent 54712c5 commit cdef5f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions instagrapi/mixins/challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def challenge_resolve_contact_form(self, challenge_url: str) -> bool:
), result
for retry_code in range(5):
for attempt in range(1, 11):
code = self.challenge_code_handler(self.username, choice)
code = self.challenge_code_handler(self.username, choice, self.code)
if code:
break
time.sleep(WAIT_SECONDS * attempt)
Expand Down Expand Up @@ -388,7 +388,7 @@ def challenge_resolve_simple(self, challenge_url: str) -> bool:
raise ChallengeError(f'ChallengeResolve: Choice "email" or "phone_number" (sms) not available to this account {self.last_json}')
wait_seconds = 5
for attempt in range(24):
code = self.challenge_code_handler(self.username, ChallengeChoice.EMAIL)
code = self.challenge_code_handler(self.username, ChallengeChoice.EMAIL, self.code)
if code:
break
time.sleep(wait_seconds)
Expand Down

0 comments on commit cdef5f1

Please # to comment.