projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6c6b8bd
)
[facebook] Extract login error
author
Sergey M․
<dstftw@gmail.com>
Mon, 28 Dec 2015 15:20:09 +0000
(21:20 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Mon, 28 Dec 2015 15:20:09 +0000
(21:20 +0600)
youtube_dl/extractor/facebook.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/facebook.py
b/youtube_dl/extractor/facebook.py
index 39c481068fbc692ba43651c84b1afb270900fa8a..1692ec1cbb830983fab3ee67b62807850ef5ab92 100644
(file)
--- a/
youtube_dl/extractor/facebook.py
+++ b/
youtube_dl/extractor/facebook.py
@@
-100,6
+100,11
@@
class FacebookIE(InfoExtractor):
login_results = self._download_webpage(request, None,
note='Logging in', errnote='unable to fetch login page')
if re.search(r'<form(.*)name="login"(.*)</form>', login_results) is not None:
login_results = self._download_webpage(request, None,
note='Logging in', errnote='unable to fetch login page')
if re.search(r'<form(.*)name="login"(.*)</form>', login_results) is not None:
+ error = self._html_search_regex(
+ r'(?s)<div[^>]+class=(["\']).*?login_error_box.*?\1[^>]*><div[^>]*>.*?</div><div[^>]*>(?P<error>.+?)</div>',
+ login_results, 'login error', default=None, group='error')
+ if error:
+ raise ExtractorError('Unable to login: %s' % error, expected=True)
self._downloader.report_warning('unable to log in: bad username/password, or exceded login rate limit (~3/min). Check credentials or wait.')
return
self._downloader.report_warning('unable to log in: bad username/password, or exceded login rate limit (~3/min). Check credentials or wait.')
return