mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 09:07:58 +01:00
[extractor/common] Interactive TFA code input
This commit is contained in:
parent
201ea3ee8e
commit
e64b756943
1 changed files with 3 additions and 2 deletions
|
@ -15,6 +15,7 @@
|
||||||
from ..compat import (
|
from ..compat import (
|
||||||
compat_cookiejar,
|
compat_cookiejar,
|
||||||
compat_cookies,
|
compat_cookies,
|
||||||
|
compat_getpass,
|
||||||
compat_HTTPError,
|
compat_HTTPError,
|
||||||
compat_http_client,
|
compat_http_client,
|
||||||
compat_urllib_error,
|
compat_urllib_error,
|
||||||
|
@ -610,7 +611,7 @@ def _get_login_info(self):
|
||||||
|
|
||||||
return (username, password)
|
return (username, password)
|
||||||
|
|
||||||
def _get_tfa_info(self):
|
def _get_tfa_info(self, note='two-factor verification code'):
|
||||||
"""
|
"""
|
||||||
Get the two-factor authentication info
|
Get the two-factor authentication info
|
||||||
TODO - asking the user will be required for sms/phone verify
|
TODO - asking the user will be required for sms/phone verify
|
||||||
|
@ -624,7 +625,7 @@ def _get_tfa_info(self):
|
||||||
if downloader_params.get('twofactor', None) is not None:
|
if downloader_params.get('twofactor', None) is not None:
|
||||||
return downloader_params['twofactor']
|
return downloader_params['twofactor']
|
||||||
|
|
||||||
return None
|
return compat_getpass('Type %s and press [Return]: ' % note)
|
||||||
|
|
||||||
# Helper functions for extracting OpenGraph info
|
# Helper functions for extracting OpenGraph info
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in a new issue