mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-22 16:57:40 +00:00
[youtube] Relax TFA regexes
This commit is contained in:
parent
e2dbcaa1bf
commit
e9fb6a4bbe
1 changed files with 4 additions and 4 deletions
|
@ -137,7 +137,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||||
# Two-Factor
|
# Two-Factor
|
||||||
# TODO add SMS and phone call support - these require making a request and then prompting the user
|
# 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')
|
tfa_code = self._get_tfa_info('2-step verification code')
|
||||||
|
|
||||||
if not tfa_code:
|
if not tfa_code:
|
||||||
|
@ -165,17 +165,17 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||||
if tfa_results is False:
|
if tfa_results is False:
|
||||||
return 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.')
|
self._downloader.report_warning('Two-factor code expired or invalid. Please try again, or use a one-use backup code instead.')
|
||||||
return False
|
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?')
|
self._downloader.report_warning('unable to log in - did the page structure change?')
|
||||||
return False
|
return False
|
||||||
if re.search(r'smsauth-interstitial-reviewsettings', tfa_results) is not None:
|
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.')
|
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
|
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')
|
self._downloader.report_warning('unable to log in: bad username or password')
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in a new issue