Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2FA not working #1217

Open
Soneji opened this issue Jul 2, 2021 · 22 comments
Open

2FA not working #1217

Soneji opened this issue Jul 2, 2021 · 22 comments
Labels
bug Bug leave open Not closed automatically due to inactivity

Comments

@Soneji
Copy link

Soneji commented Jul 2, 2021

Session file does not exist yet - Logging in.
Enter Instagram password for _____:
Enter 2FA verification code: XXXXXX
2FA error: This code is no longer valid. Please request a new one.
Enter 2FA verification code:

This happens again and again, I even tried setting up a 2FA app, but this did not work (I read the issue and you guys dont support it)

instaloader --version
4.7.4

Any help would be appreciated, thank you!

@Soneji Soneji added the bug Bug label Jul 2, 2021
@usma0118 usma0118 mentioned this issue Jul 7, 2021
@usma0118

This comment was marked as spam.

@aandergr
Copy link
Member

Thanks for reporting.

@valdearg

This comment was marked as spam.

@jamesbaber

This comment was marked as spam.

@lucabinotti

This comment was marked as spam.

@Soneji
Copy link
Author

Soneji commented Jul 21, 2021

No point spamming, just leave a 👍 on my original post, I'm sure the team are working on it as you can see

Thanks for reporting.

@Soneji

This comment was marked as spam.

@aandergr
Copy link
Member

We will track all updates related to this issue here, I recommend to use the subscribe or watch feature of github to get informed about updates.

Until this is fixed, the workaround described in https://instaloader.github.io/troubleshooting.html#login-error can be used.

@riccardogabellone
Copy link

riccardogabellone commented Nov 16, 2021

We will track all updates related to this issue here, I recommend to use the subscribe or watch feature of github to get informed about updates.

Until this is fixed, the workaround described in https://instaloader.github.io/troubleshooting.html#login-error can be used.

I have the same issue, but in Android using Termux, .py script cannot be used if phone is not rooted (I figured out this after trying to use -c parameter and get cookies from /data/data/org.mozilla.firefox/files/mozilla/xxxxxxxx.default/ as mentioned here)

[EDIT] After a few tryings, solution for Andorid/Termux is to use session exported from PC (obtained by the .py script you have provided) and call the command by always using -f parameter, like this example:
instaloader myUser --stories --login=myUser -f ~/session-myUser

@Dan1jel

This comment was marked as spam.

@bitwon

This comment was marked as spam.

@benjaminu
Copy link

Same issue here. Tried both cli (--login) and code versions; same error in both cases.

    loader = instaloader.Instaloader()
    try:
        loader.login(username, password)
    except TwoFactorAuthRequiredException:
        two_factor_code = input("Enter 2FA Code: ")
        loader.two_factor_login(two_factor_code)
instaloader.exceptions.BadCredentialsException: 2FA error: This code is no longer valid. Please request a new one.

instaloader --version - 4.8.4

I'm using an authenticator app. I've also tried disabling it to trigger the the SMS version, but that doesn't work either.

@ThijmenDam
Copy link

ThijmenDam commented Feb 28, 2022

Having the same issue. The codes are working on other places like the Instagram app. The workaround mentioned above worked for me after editing the path to the FireFox cookies.

@github-actions
Copy link

There has been no activity on this issue for an extended period of time. This issue will be closed after further 14 days of inactivity.

@github-actions github-actions bot added the stale Issue is inactive for a long time label Jul 13, 2022
@usma0118
Copy link

Adding comment to keep this alive.

@aandergr aandergr added leave open Not closed automatically due to inactivity and removed stale Issue is inactive for a long time labels Jul 23, 2022
@TCB13

This comment was marked as spam.

@GMaxera
Copy link

GMaxera commented Oct 10, 2022

Having this issue with version 4.9.5
Also affected by issue #92
I'm not using Firefox, I'm using Brave browser, so the workaround that uses Firefox session cookies won't work for me

@paboum
Copy link

paboum commented Jan 20, 2024

The workaround does not work with firefox containers either. Had to start a whole new profile, log in there, export with 615... script which also wouldn't just run from git-cloned directory, had to create a venv to pip install the instaloader lib. This is really cumbersome and I see no excuse for at least integrating that script into main app.

@bonished
Copy link

Tested today, 2FA still not working in 4.11 standalone app.
"2FA error: This code is no longer valid. Please request a new one."
Tried with like 5 codes already, tried current, tried previous, even after some time but no luck.
It's indeed cumbersome to deal with firefox and all this stuff.

@francescoparra
Copy link

francescoparra commented Apr 8, 2024

I'm having the same issue as the previous comment:
instaloader.exceptions.BadCredentialsException: 2FA error: This code is no longer valid. Please request a new one.
There is the #1784 PR but it doesn't fix it anyway, at least to me

@prankousky
Copy link

Same here. Version 4.11. I get the 2FA code via text, enter it instantly, but it won't take.

@s4m77
Copy link

s4m77 commented May 17, 2024

still no workarounds?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug leave open Not closed automatically due to inactivity
Projects
None yet
Development

No branches or pull requests