projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
107701f
)
[youtube] Capture and output login error message
author
Sergey M․
<dstftw@gmail.com>
Wed, 20 Apr 2016 16:14:32 +0000
(22:14 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Wed, 20 Apr 2016 16:14:32 +0000
(22:14 +0600)
youtube_dl/extractor/youtube.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/youtube.py
b/youtube_dl/extractor/youtube.py
index a4dd628a1114d5aeb156b025db75ee31544da5f7..44f98d294909a75f44f9c01e3a2ce0e7c66d86b5 100644
(file)
--- a/
youtube_dl/extractor/youtube.py
+++ b/
youtube_dl/extractor/youtube.py
@@
-125,6
+125,12
@@
class YoutubeBaseInfoExtractor(InfoExtractor):
if login_results is False:
return False
if login_results is False:
return False
+ error_msg = self._html_search_regex(
+ r'<[^>]+id="errormsg_0_Passwd"[^>]*>([^<]+)<',
+ login_results, 'error message', default=None)
+ if error_msg:
+ raise ExtractorError('Unable to login: %s' % error_msg, expected=True)
+
if re.search(r'id="errormsg_0_Passwd"', login_results) is not None:
raise ExtractorError('Please use your account password and a two-factor code instead of an application-specific password.', expected=True)
if re.search(r'id="errormsg_0_Passwd"', login_results) is not None:
raise ExtractorError('Please use your account password and a two-factor code instead of an application-specific password.', expected=True)