aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/__init__.py
diff options
context:
space:
mode:
authorriking <rikingcoding@gmail.com>2014-08-16 14:28:41 -0700
committerriking <rikingcoding@gmail.com>2014-08-16 14:48:17 -0700
commit83317f693870424c2c769e4d964453401063fdf1 (patch)
treec39f0fa5a5ef189bec53cdd8149511ba4f6869b8 /youtube_dl/__init__.py
parentc1d293cfa68031e0ec1a4190041f280d22c2b026 (diff)
[youtube] Add two-factor account signin (TOTP only)
Additional work is required to prompt the user for the SMS or phone call codes, as there is no framework currently to prompt the user during an extraction operation. Fixes #3533
Diffstat (limited to 'youtube_dl/__init__.py')
-rw-r--r--youtube_dl/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py
index 962aedbff..80de211e7 100644
--- a/youtube_dl/__init__.py
+++ b/youtube_dl/__init__.py
@@ -314,6 +314,8 @@ def parseOpts(overrideArguments=None):
dest='username', metavar='USERNAME', help='account username')
authentication.add_option('-p', '--password',
dest='password', metavar='PASSWORD', help='account password')
+ authentication.add_option('-2', '--twofactor',
+ dest='twofactor', metavar='TWOFACTOR', help='two-factor auth code')
authentication.add_option('-n', '--netrc',
action='store_true', dest='usenetrc', help='use .netrc authentication data', default=False)
authentication.add_option('--video-password',
@@ -748,6 +750,7 @@ def _real_main(argv=None):
'usenetrc': opts.usenetrc,
'username': opts.username,
'password': opts.password,
+ 'twofactor': opts.twofactor,
'videopassword': opts.videopassword,
'quiet': (opts.quiet or any_printing),
'no_warnings': opts.no_warnings,