diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-12-28 21:20:09 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-12-28 21:20:09 +0600 |
commit | 9f66931e160ec7c4cc3be8bf731da32b0bfa9043 (patch) | |
tree | c978c351047eb4d3e9c2a68e129d71c46cb25183 /youtube_dl | |
parent | 6c6b8bd5ccef10aad73ee5a556830f9b00b93661 (diff) |
[facebook] Extract login error
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/facebook.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/facebook.py b/youtube_dl/extractor/facebook.py index 39c481068..1692ec1cb 100644 --- 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: + 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 |