2FA not transmitted #1344
VincentEmmanuel
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I keep getting this error
Error occurred during login: Two-factor authentication required (you did not provide verification_code for login method)
This is my current test code.
import instagrapi
import random
import time
Set up your Instagram account credentials
username = "xxxx"
password = "xxxx"
Initialize the Instagram client
client = instagrapi.Client()
Prompt the user to enter the verification code
verification_code = input("Enter the verification code: ")
Login and check if the login is successful
try:
client.login(username, password, verification_code)
if not client.is_authenticated:
raise Exception("Login unsuccessful. Please check your credentials.")
print("Login successful.")
except Exception as e:
print(f"Error occurred during login: {str(e)}")
exit()
Rest of the code...
cl.dump_settings('/tmp/dump.json')
Any idea?
Beta Was this translation helpful? Give feedback.
All reactions