diff options
author | Remita Amine <remitamine@gmail.com> | 2017-04-20 05:16:41 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2017-04-20 05:16:41 +0100 |
commit | 8abc7dca39236462c0652932df23862acda92d51 (patch) | |
tree | c3383e70ada76f7fccef9c6cd07569f42bc8100d /youtube_dl | |
parent | ea0c2f219c219de8f59f1ae82e106cec5911c56c (diff) |
[amp] extract error message(closes #12795)
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/amp.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube_dl/extractor/amp.py b/youtube_dl/extractor/amp.py index e8e40126b..98f8e69cd 100644 --- a/youtube_dl/extractor/amp.py +++ b/youtube_dl/extractor/amp.py @@ -7,15 +7,19 @@ from ..utils import ( parse_iso8601, mimetype2ext, determine_ext, + ExtractorError, ) class AMPIE(InfoExtractor): # parse Akamai Adaptive Media Player feed def _extract_feed_info(self, url): - item = self._download_json( + feed = self._download_json( url, None, 'Downloading Akamai AMP feed', - 'Unable to download Akamai AMP feed')['channel']['item'] + 'Unable to download Akamai AMP feed') + item = feed.get('channel', {}).get('item') + if not item: + raise ExtractorError('%s said: %s' % (self.IE_NAME, feed['error'])) video_id = item['guid'] |