Skip to content

Commit

Permalink
Update private.py
Browse files Browse the repository at this point in the history
add code parameter in manual_input_code function;
  • Loading branch information
Jmallone authored Mar 16, 2022
1 parent a27e62d commit 827750d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions instagrapi/mixins/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from instagrapi.utils import dumps, generate_signature


def manual_input_code(self, username: str, choice=None):
def manual_input_code(self, username: str, choice=None, code=None):
"""
Manual security code helper
Expand All @@ -46,11 +46,12 @@ def manual_input_code(self, username: str, choice=None):
str
Code
"""
code = None
while True:
code = input(f"Enter code (6 digits) for {username} ({choice}): ").strip()
if code and code.isdigit():
break
time.sleep(10)
if code == None:
print("Invalid code")
return 3455

print("Enviando codigo")
return code # is not int, because it can start from 0


Expand Down

0 comments on commit 827750d

Please # to comment.