From 83317f693870424c2c769e4d964453401063fdf1 Mon Sep 17 00:00:00 2001 From: riking Date: Sat, 16 Aug 2014 14:28:41 -0700 Subject: [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 --- youtube_dl/extractor/common.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'youtube_dl/extractor/common.py') diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 342bfb8b3..9f6a8a889 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -434,6 +434,24 @@ class InfoExtractor(object): return (username, password) + def _get_tfa_info(self): + """ + Get the two-factor authentication info + TODO - asking the user will be required for sms/phone verify + currently just uses the command line option + If there's no info available, return None + """ + if self._downloader is None: + self.to_screen("no downloader") + return None + downloader_params = self._downloader.params + + if downloader_params.get('twofactor', None) is not None: + return downloader_params['twofactor'] + + self.to_screen("param is None") + return None + # Helper functions for extracting OpenGraph info @staticmethod def _og_regexes(prop): -- cgit v1.2.3 From 165250ff5e33d1b246dffaade23b31b4fa3f3b02 Mon Sep 17 00:00:00 2001 From: riking Date: Sat, 16 Aug 2014 14:49:30 -0700 Subject: Remove debug prints --- youtube_dl/extractor/common.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'youtube_dl/extractor/common.py') diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 9f6a8a889..45a17f8ad 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -442,14 +442,12 @@ class InfoExtractor(object): If there's no info available, return None """ if self._downloader is None: - self.to_screen("no downloader") return None downloader_params = self._downloader.params if downloader_params.get('twofactor', None) is not None: return downloader_params['twofactor'] - self.to_screen("param is None") return None # Helper functions for extracting OpenGraph info -- cgit v1.2.3