- video_id = self._match_id(url)
- base_url = 'http://dctp-ivms2-restapi.s3.amazonaws.com/'
- version_json = self._download_json(
- base_url + 'version.json',
- video_id, note='Determining file version')
- version = version_json['version_name']
- info_json = self._download_json(
- '{0}{1}/restapi/slugs/{2}.json'.format(base_url, version, video_id),
- video_id, note='Fetching object ID')
- object_id = compat_str(info_json['object_id'])
- meta_json = self._download_json(
- '{0}{1}/restapi/media/{2}.json'.format(base_url, version, object_id),
- video_id, note='Downloading metadata')
- uuid = meta_json['uuid']
- title = meta_json['title']
- wide = meta_json['is_wide']
- if wide:
- ratio = '16x9'
+ display_id = self._match_id(url)
+
+ webpage = self._download_webpage(url, display_id)
+
+ video_id = self._html_search_meta(
+ 'DC.identifier', webpage, 'video id',
+ default=None) or self._search_regex(
+ r'id=["\']uuid[^>]+>([^<]+)<', webpage, 'video id')
+
+ title = self._og_search_title(webpage)
+
+ servers = self._download_json(
+ 'http://www.dctp.tv/streaming_servers/', display_id,
+ note='Downloading server list', fatal=False)
+
+ if servers:
+ endpoint = next(
+ server['endpoint']
+ for server in servers
+ if isinstance(server.get('endpoint'), compat_str) and
+ 'cloudfront' in server['endpoint'])