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

2-way auth to google #1336

Open
Forever-Young opened this issue Aug 28, 2013 · 16 comments · May be fixed by #18521
Open

2-way auth to google #1336

Forever-Young opened this issue Aug 28, 2013 · 16 comments · May be fixed by #18521
Labels

Comments

@Forever-Young
Copy link
Contributor

@Forever-Young Forever-Young commented Aug 28, 2013

Does youtube-dl work with 2-way authentication to google, or application-specific passwords?
I tried both account password and app-specific generated password, 'unable to log in'

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Aug 28, 2013

Currently it just uses your email and password, so if you have 2-way auth enabled i don't think it will work.
@Forever-Young and @AnnanFay, after you use youtube-dl with your login info, did you receive a verification code as usual?

@Forever-Young
Copy link
Contributor Author

@Forever-Young Forever-Young commented Aug 28, 2013

I didn't receive any verification code.
I also tried account w/o 2-way auth (custom domain though), and also got an error:

$ youtube-dl -u email@mydomain :ytsubs
Type account password and press return:
[youtube:subscriptions] Logging in
WARNING: unable to log in: bad username or password
@Forever-Young
Copy link
Contributor Author

@Forever-Young Forever-Young commented Aug 28, 2013

I created new google account just now, and tried it, also unable to log in. Maybe I do something wrong?

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Aug 30, 2013

I can login with my account without problems and I don't think using an account with custom domain should be a problem.

@Forever-Young
Copy link
Contributor Author

@Forever-Young Forever-Young commented Aug 30, 2013

I tried one more time just now - custom domain and gmail w/o 2-way auth - ok.
Account with 2-way auth - SMS came.
Application-specific password - doesn't work.

@hjbotha
Copy link

@hjbotha hjbotha commented Aug 31, 2013

It might be preferable and easier to implement application-specific password support, so that users can create a password specifically for youtube-dl to use rather than their main Google password.

The main benefits:
Passwords can be easily revoked, so it's easy to take care of if compromised.
Wouldn't require youtube-dl to prompt for the 2-factor authentication code.

@fuadsaud
Copy link

@fuadsaud fuadsaud commented Dec 24, 2013

yes, yes, app specific password :) ping?

@Hajitorus
Copy link

@Hajitorus Hajitorus commented Jan 21, 2014

I'm using two-factor auth on my google/youtube account, but don't have a phone number set up (no verifications sent to mobile). I do have the google authenticator app paired with my account, and can generate app-specific passwords, but neither of these options seem to be supported by yt-dl. Because of this, I'm unable to use :ytsubs, and am currently relying on a script that basically does for user in $sublist; do youtube-dl ytuser:$user; done.

@FernandoMiguel
Copy link

@FernandoMiguel FernandoMiguel commented Mar 16, 2014

i'm coming from #2542 .
using custom domain, 2FA account with several fallbacks (code, SMS, phone call).
I cant really login
has there been any progress on this topic?

@FernandoMiguel
Copy link

@FernandoMiguel FernandoMiguel commented May 13, 2014

google killed today RSS, making this mater even more urgent.
without 2FA, I cant login with YTDL and pull my subscriptions

source http://arstechnica.com/gadgets/2014/05/youtube-shuts-down-public-rss-feeds-of-user-subscriptions/

@scottfromsf
Copy link

@scottfromsf scottfromsf commented Feb 18, 2017

Google 2FA seems to be working now. I don't know how long this has been the case but someone might want to close this issue.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Feb 19, 2017

Since #3534 TOTP (using the Google Authenticator app or equivalent) is supported via --twofactor. I don't use other 2FA code generation approaches. Maybe others can have a check?

@mholt
Copy link

@mholt mholt commented Jul 2, 2017

Using 2FA with TOTP on my Google acount results in a 500 error (using youtube-dl 2017.06.25):

youtube-dl https://www.youtube.com/watch?v=rAUJN48IHXw --username="<email>"
Type account password and press [Return]: 
[youtube] Downloading login page
[youtube] Looking up account info
[youtube] Logging in
Type 2-step verification code and press [Return]: 
[youtube] Submitting TFA code
WARNING: Unable to submit TFA code: HTTP Error 500: Internal Server Error

After entering my password, my Android Phone asks "are you trying to log in to your Google account?" - I've tried various combinations of saying Yes and ignoring the prompt and entering the TOTP code into the terminal but all result in the 500 error. So, I don't think this is working...

@paradonym
Copy link

@paradonym paradonym commented Jun 26, 2018

PS F:\Video\Youtube\Originals\REDACTED> youtube-dl --version
2018.06.19
PS F:\Video\Youtube\Originals\REDACTED> youtube-dl https://www.youtube.com/watch?v=U3lWVLuc6CE --username="REDACTED@gmail.com"
Type account password and press [Return]:
[youtube] Downloading login page
[youtube] Looking up account info
[youtube] Logging in
Type 2-step verification code and press [Return]:
[youtube] Submitting TFA code
WARNING: Unable to submit TFA code: HTTP Error 400: Bad Request

I just tried a Youtube RED video I have access to, and the login using the official way always fails - passing an app-specific password also fails, but somehow on the message that the password isn't valid.

are you sure they collect the way using Google Authenticator? The default is the Yubikey and among the list of various phone and mobile numbers Google Authenticator is just one of many options.

@AzureRaptor
Copy link

@AzureRaptor AzureRaptor commented Sep 9, 2018

I'm in the exact situation as mholt above, except my error is "400: Bad Request". The video(s) are not DRM-protected or anything special. I get the prompt on my Android phone, etc., and enter the 2FA code, but no matter what I do, it always errors out with that 400 error.

It seems like the Google Authenticator 2FA code is not being properly submitted somehow. Is there any movement on this issue?

@chenrui333
Copy link

@chenrui333 chenrui333 commented Oct 30, 2018

Have the exact problem.

$ youtube-dl -u "<email>"  https://www.youtube.com/watch?v=rAUJN48IHXw -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-u', u'PRIVATE', u'https://youtube.com/watch?v=rAUJN48IHXw', u'-v']
Type account password and press [Return]:
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.10.29
[debug] Python version 2.7.15 (CPython) - Darwin-18.0.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.0.2, ffprobe 4.0.2
[debug] Proxy map: {}
[youtube] Downloading login page
[youtube] Looking up account info
[youtube] Logging in
Type 2-step verification code and press [Return]:
[youtube] Submitting TFA code
WARNING: Unable to submit TFA code: HTTP Error 500: Internal Server Error
[youtube] rAUJN48IHXw: Downloading webpage
[youtube] rAUJN48IHXw: Downloading video info webpage
WARNING: Unable to extract video title
ERROR: This video is unavailable.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 792, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 508, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1897, in _real_extract
    raise ExtractorError(error_message, expected=True)
ExtractorError: This video is unavailable.
@eduardog3000 eduardog3000 linked a pull request that will close this issue Dec 14, 2018
5 of 9 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

You can’t perform that action at this time.