Skip to content

Commit

Permalink
Update instaclient.py
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwickerhf committed Oct 29, 2020
1 parent d7c7479 commit d62ac76
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions instaclient/client/instaclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,17 @@ def login(self, username:str, password:str, check_user:bool=True):
# Detect Suspicious Login Attempt Dialogue
send_code = self.__check_existence(EC.presence_of_element_located((By.XPATH, Paths.SEND_CODE)), wait_time=3)
if send_code:
print('Suspicious Login Attempt.')
send_code = self.__find_element(EC.presence_of_element_located((By.XPATH, Paths.SEND_CODE)), wait_time=4)
send_code.click()
print('Sent Security Code')
raise SuspisciousLoginAttemptError()

# Detect 2FS
scode_input = self.__check_existence(EC.presence_of_element_located((By.XPATH, Paths.VERIFICATION_CODE)), wait_time=3)
if scode_input:
# 2F Auth is enabled, request security code
print('2FA Required. Check Auth App')
raise VerificationCodeNecessary()
else:
self.logged_in = True
Expand Down

0 comments on commit d62ac76

Please sign in to comment.