diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-10-17 01:02:17 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-10-17 01:02:17 +0200 |
commit | 591454798d330adfcf8e22ef66fed7bbdf9f628b (patch) | |
tree | 11165f3a47505eafdf064bf386fe981f6bcd1437 /youtube_dl/extractor | |
parent | 38604f1a4f26c78b69898c639a8f75432c2d3382 (diff) |
[brightcove] Raise error if playlist is empty (#1608)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/brightcove.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py index 58f3d9708..1392f382a 100644 --- a/youtube_dl/extractor/brightcove.py +++ b/youtube_dl/extractor/brightcove.py @@ -98,7 +98,10 @@ class BrightcoveIE(InfoExtractor): playlist_info = self._download_webpage(self._PLAYLIST_URL_TEMPLATE % player_key, player_key, u'Downloading playlist information') - playlist_info = json.loads(playlist_info)['videoList'] + json_data = json.loads(playlist_info) + if 'videoList' not in json_data: + raise ExtractorError(u'Empty playlist') + playlist_info = json_data['videoList'] videos = [self._extract_video_info(video_info) for video_info in playlist_info['mediaCollectionDTO']['videoDTOs']] return self.playlist_result(videos, playlist_id=playlist_info['id'], |