- video_data = None
- formats = []
- for partner in (154, 213):
- vdata = self._download_json(
- 'http://metaframe.digitalsmiths.tv/v2/CWtv/assets/%s/partner/%d?format=json' % (video_id, partner), video_id, fatal=False)
- if not vdata:
- continue
- video_data = vdata
- for quality, quality_data in vdata.get('videos', {}).items():
- quality_url = quality_data.get('uri')
- if not quality_url:
- continue
- if quality == 'variantplaylist':
- formats.extend(self._extract_m3u8_formats(
- quality_url, video_id, 'mp4', m3u8_id='hls', fatal=False))
- else:
- tbr = int_or_none(quality_data.get('bitrate'))
- format_id = 'http' + ('-%d' % tbr if tbr else '')
- if self._is_valid_url(quality_url, video_id, format_id):
- formats.append({
- 'format_id': format_id,
- 'url': quality_url,
- 'tbr': tbr,
- })
- self._sort_formats(formats)
-
- thumbnails = [{
- 'url': image['uri'],
- 'width': image.get('width'),
- 'height': image.get('height'),
- } for image_id, image in video_data['images'].items() if image.get('uri')] if video_data.get('images') else None
-
- video_metadata = video_data['assetFields']
+ data = self._download_json(
+ 'http://images.cwtv.com/feed/mobileapp/video-meta/apiversion_8/guid_' + video_id,
+ video_id)
+ if data.get('result') != 'ok':
+ raise ExtractorError(data['msg'], expected=True)
+ video_data = data['video']
+ title = video_data['title']
+ mpx_url = video_data.get('mpx_url') or 'http://link.theplatform.com/s/cwtv/media/guid/2703454149/%s?formats=M3U' % video_id