Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[YouTube] Unable to authenticate with enabled TFA #15184
Comments
|
Found the same issue just now when attempting to grab my Watch Later for a flight.
EDIT: updated to current and re-ran |
|
Same *it here. Looks like cookie was expired and app tried to login back, but can't get thru TFA
Just for sure with Python 3.x.x
|
|
Receiving same error with Python 2.7.x
|
|
I have the same issue on Windows 7 - error 400 when trying to pass verfication code:
|
|
Also having this issue. Using the Authenticator App for codes
|
|
@Vulp35 I'm working on a fix. What 2FA methods (Authenticator code, texted code, prompt in Google/Gmail app) do you have turned on on your Google account? Which one is the default, the one it asks for when you try to log in with a browser (use incognito if you don't know)? |
|
@eduardog3000 , for mine, my YouTube 2FA is via Google Authenticator.
|
|
@sandalle What error do you get when you try to log in with youtube-dl? Then can you download this branch and tell me what happens when you try to log in (use |
I'm unsure why those aren't working, but using my ~/.netrc values worked in that I got
I've cloned git@github.com:eduardog3000/youtube-dl.git seems to work with 2FA. :)
I also tried downloading a playlist, and the first item worked with 2FA and the second continued to work with the 2FA session. :)
|
|
If I were you I'd mask your logins. |
|
But it's good to see my code works for you. Just to be sure, this is the very first screen you see after inputting your password in a normal browser? Not something like this: |
Correct, that's what I see after using a browser in Privacy mode. |
|
@sandalle Thank you. Now I need someone who gets the Once I confirm that I should be ready to submit a PR. |
I can add prompt as well if that helps you. Also, can confirm this fix is working with the Authenticator App
|
|
Oh, good, Prompt started working for me (you can see in my image above I got locked out of it), so I could test it myself. Looks like all is good, I'll submit the PR. |
Anything special I have to do for prompt? I accepted then hit enter but that didn't seem to work? |
|
@Vulp35 youtube-dl can't actually use the prompt, it still needs the Google Authenticator code, but I wanted to make sure that someone with the prompt enabled was still able to use the code through youtube-dl. The way the fix works I wasn't completely sure it would work when Google asks for the prompt by default. |
|
@eduardog3000 oh gotcha! Yup can also confirm it working with prompt enabled as the default but using a code from Authenticator in youtube-dl |
|
I think I am running into this because my YubiKey is my default authenticator. |
|
I am having the same difficulty with the version 2018.11.23 and the forked version that was modified by @eduardog3000 . This was difficult to test on Windows without an executable, but I figured it out. In any case, when I temporarily disable 2FA on my account, both the stock and modified versions worked for me. So I am not sure what the fix was supposed to do, but I saw no change in behavior.
|
|
I'm still having this issue in version 2019.02.08. I use SMS messages as my TFA method. Version proof:
Debug output on Windows:
Side note: |
|
@uruiamme Which version is that log from? My fork might be broken for reasons other than TFA because it is a fork of an old version. The newest official version still doesn't work with TFA because no fix has been merged in. This branch is both the newest youtube-dl version, and has my fix applied. It should work for you and anyone who has TOTP TFA enabled. If not, post the log from it. |
|
@eduardog3000 I had followed your link to https://github.com/eduardog3000/youtube-dl/tree/tfa-fix So my test found out that both 2018.11.23 (stock) and yours based on 2018.11.23 were both still not working. I have not tried the new one. Why would the new one work? Did your fix change anything or did the main trunk make changes to TFA problems? |
|
@uruiamme 2018.11.23 stock is old and doesn't work anymore for reasons unrelated to TFA. YouTube changes things a lot, and youtube-dl has to keep up. My version based on 2018.11.23 doesn't work for the same reason. The new branch is based on the latest commit to this main repo, so it should work where 2018.11.23 doesn't. But if YouTube has changed anything about TFA since then, my fix might not work no matter the base version. Try my |
|
@dstftw @remitamine Can you at least say what the current blockers are for merging the fix? The latest PR was simply locked with no further feedback given. Links:
@eduardog3000 just curious, why create a new branch instead of rebasing the old one? |
|
@FranciscoPombal as a quick fix for the person who was asking me about it here. If the maintainers are willing to merge my code I'd happily get it all sorted. Although the code in my PR, while based on an old upstream commit, can still be merged without conflict. |
|
Is there some lingering issue with the PR that's preventing merge? |
|
@LoneFenris There was an issue, I fixed it, then the collaborator never responded and eventually locked the conversation. |
|
Still having this issue with youtube-dl version 2019.10.29 |
|
@raffaem From the conversation on the associated PR, it appears there may be two issues with it:
|



Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2017.12.31. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add the
-vflag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):Description of your issue, suggested solution and other information
Unable to authenticate with enabled TFA on account.
Returns HTTP Error 400 after typing 2-step verification code.
Happens in any way of authentication:
.netrc, direct passing login+pass via cmd args, direct passing login+pass+tfacode via cmd args.