aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-07-11 03:08:38 +0700
committerSergey M․ <dstftw@gmail.com>2016-07-11 03:08:38 +0700
commite9fb6a4bbee2eaf068a4499ce8fa4df89458a3c3 (patch)
tree9b1eb2cc4a10c717253288fa485772d7e26a3fb2
parente2dbcaa1bf65aa502718005d5fbd00189618469f (diff)
[youtube] Relax TFA regexes
-rw-r--r--youtube_dl/extractor/youtube.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 8aa7dfc41..1687d5ef9 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -137,7 +137,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
# Two-Factor
# TODO add SMS and phone call support - these require making a request and then prompting the user
- if re.search(r'(?i)<form[^>]* id="challenge"', login_results) is not None:
+ if re.search(r'(?i)<form[^>]+id="challenge"', login_results) is not None:
tfa_code = self._get_tfa_info('2-step verification code')
if not tfa_code:
@@ -165,17 +165,17 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
if tfa_results is False:
return False
- if re.search(r'(?i)<form[^>]* id="challenge"', tfa_results) is not None:
+ if re.search(r'(?i)<form[^>]+id="challenge"', tfa_results) is not None:
self._downloader.report_warning('Two-factor code expired or invalid. Please try again, or use a one-use backup code instead.')
return False
- if re.search(r'(?i)<form[^>]* id="gaia_loginform"', tfa_results) is not None:
+ if re.search(r'(?i)<form[^>]+id="gaia_loginform"', tfa_results) is not None:
self._downloader.report_warning('unable to log in - did the page structure change?')
return False
if re.search(r'smsauth-interstitial-reviewsettings', tfa_results) is not None:
self._downloader.report_warning('Your Google account has a security notice. Please log in on your web browser, resolve the notice, and try again.')
return False
- if re.search(r'(?i)<form[^>]* id="gaia_loginform"', login_results) is not None:
+ if re.search(r'(?i)<form[^>]+id="gaia_loginform"', login_results) is not None:
self._downloader.report_warning('unable to log in: bad username or password')
return False
return True