jarrodnorwell / InstaPy2

Instagram automation tool for farming comments, follows and likes, written in Python
GNU General Public License v3.0
52 stars 9 forks source link

2FA #1

Closed Wathfea closed 2 years ago

Wathfea commented 2 years ago

Hi,

Can you please tell me how to use and setup 2FA? Also is it enough to dodge the challange for Instagram or to achive it I need to setup a chalange resolver with gmail imap?

jarrodnorwell commented 2 years ago

Currently email and sms aren't supported but it will be shortly, as for the code you will have to type it prior to running the script and then once you have a successful login (first time, ensure files/* is deleted) you can remove the 2FA argument.

Wathfea commented 2 years ago

Okay, thank you!

Wathfea commented 2 years ago

One more question thought.

I enabled 2FA on Instagram. Tried to log in with the bot: logged_in = self.session.login(username=username, password=password) And I got the verification code via sms. Then I tried to log in again logged_in = self.session.login(username=username, password=password, verification_code=given_code) But it is not working and I got a new sms.

What I not understand fully how can I log in without the code in the first time?

jarrodnorwell commented 2 years ago

@Wathfea SMS isn't supported by instagrapi at the moment so email or an authenticator app is recommended.

Email isn't added to InstaPy2 yet hence the "Tested with Apple Verification Code" but I'll be sure to add the email support soon.

Wathfea commented 2 years ago

@official-antique hey, maybe I'm not clear, sorry for that. I can implement the email check actually I already implemented it in my code. What I don't understand how I got the verification code at the first time?

So I run my app, It tries to login, but at this moment it doesn't have any verification code because the code will arrive after I try to login. I got the code via email, sms, doesn't matter. I copy the code and pass it as a param and try to log in again. Fails again because the system detects a new login attempt and resends the code.

This is why I don't understand how you can login at the first time? How do you know the verification code before login?

jarrodnorwell commented 2 years ago

@Wathfea Apple/Authentication apps show the code as it's time stamp based (loose explanation) and gets randomly generated every 30 seconds normally.

Email and SMS would require the script to be "stalled" in a sense so you could slip the code into place, that may be what challenge_code_handler does.