- video_info = self._download_json(
- player_info['url'] + '/' + player_type + '/' + video_id +
- '?apiKey=sh%40hid0nlin3&hash=b2wMCTHpSmyxGqQjJFOycRmLSex%2BBpTK%2Fooxy6vHaqs%3D',
- video_id
- )['data']
- if video_info['error']:
- for error in video_info['error']:
- raise ExtractorError(error)
- video_info = video_info[player_type]
- if video_info.get('availabilities').get('plus'):
- raise ExtractorError('plus members only')
- title = video_info['title']
- thumbnail = video_info.get('thumbnailUrl')
- categories = [category['name'] for category in video_info.get('genres')]
- description = video_info.get('description')
- duration = int_or_none(video_info.get('duration'))
+ player = self._call_api(
+ 'Content/Episode/%s' % video_id,
+ video_id, 'Downloading player JSON')
+
+ if player.get('drm'):
+ raise ExtractorError('This video is DRM protected.', expected=True)
+
+ formats = self._extract_m3u8_formats(player['url'], video_id, 'mp4')
+ self._sort_formats(formats)
+
+ video = self._call_api(
+ 'episode/%s' % video_id, video_id,
+ 'Downloading video JSON')['episode']
+
+ title = video['title']
+ categories = [
+ category['name']
+ for category in video.get('genres', []) if 'name' in category]