diff options
author | remitamine <[email protected]> | 2015-11-01 13:38:11 +0100 |
---|---|---|
committer | remitamine <[email protected]> | 2015-11-01 13:38:11 +0100 |
commit | f3003531a5622cc01501325b9f35dcb2424cfb70 (patch) | |
tree | 1377757660e4ac55dc147a80d692a79f095cde9a | |
parent | 146672254e409bf97c82a302095fbfabf2c48928 (diff) | |
download | youtube-dl-f3003531a5622cc01501325b9f35dcb2424cfb70.tar.gz youtube-dl-f3003531a5622cc01501325b9f35dcb2424cfb70.zip |
[flickr] handle error message
-rw-r--r-- | youtube_dl/extractor/flickr.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/youtube_dl/extractor/flickr.py b/youtube_dl/extractor/flickr.py index 0d5d6b0b9..e97754d36 100644 --- a/youtube_dl/extractor/flickr.py +++ b/youtube_dl/extractor/flickr.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse from ..utils import ( + ExtractorError, int_or_none, qualities, ) @@ -39,7 +40,10 @@ class FlickrIE(InfoExtractor): } if secret: query['secret'] = secret - return self._download_json(self._API_BASE_URL + compat_urllib_parse.urlencode(query), video_id, note) + data = self._download_json(self._API_BASE_URL + compat_urllib_parse.urlencode(query), video_id, note) + if data['stat'] != 'ok': + raise ExtractorError(data['message']) + return data def _real_extract(self, url): video_id = self._match_id(url) |