In Instabot, how can I make the program ask the user again if he misses the password or username?

Asked

Viewed 31 times

0

from instabot import Bot
bot: Bot = Bot()
print('Bem vindo ao Fox_InstaBot!\nFaça seu Login.')
ret = bot.login(username=str(input('User_Name:')),
            password=str(input('User_PassWord:')))

I’m using the library instabot for a small project, but I came across a problem. When the user type the username and password wrong, the program stops. Presenting the following:

Bem vindo ao Fox_InstaBot!
Faça seu Login.
User_Name:AAAAA
User_PassWord:BBBB
2020-12-16 10:56:39,378 - INFO - Not yet logged in starting: PRE-LOGIN FLOW!
2020-12-16 10:56:43,206 - ERROR - Request returns 400 error!
2020-12-16 10:56:43,206 - INFO - Instagram's error message: The password you entered is incorrect. 
Please try again.
2020-12-16 10:56:43,206 - INFO - Error type: bad_password
2020-12-16 10:56:43,206 - ERROR - Failed to login go to instagram and change your password
2020-12-16 10:56:43,206 - INFO - Username or password is incorrect.

I have tried using Loop commands by assigning the variable Ret a bool. But it didn’t work. Does anyone have any idea how I can get the program to ask the user again if it misses Login without the program stopping altogether?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.