- video_id = self._match_id(url)
-
- webpage = self._download_webpage(url, video_id)
- episode_code = self._search_regex(
- r'(?s)episode:(.*?\}),\s*\n', webpage, 'episode information')
-
- ep = self._parse_json(
- episode_code, video_id, transform_source=lambda s:
- re.sub(r'(\n\s+)([a-zA-Z]+):\s+\'(.*?)\'', r'\1"\2": "\3"', s))
-
- if ep['providerType'] == 'Ooyala':
- return {
- '_type': 'url_transparent',
- 'ie_key': 'Ooyala',
- 'url': 'ooyala:%s' % ep['providerId'],
- 'id': video_id,
- 'title': ep['title'],
- 'description': ep.get('description'),
- 'thumbnail': ep.get('imageThumbnail'),
- }
- else:
- raise ExtractorError('Unsupported provider %s' % ep['provider'])
+ mobj = re.match(self._VALID_URL, url)
+ video_id = mobj.group('id')
+ display_id = mobj.group('display_id') or video_id
+
+ ep = self._download_json(
+ 'https://api.byutv.org/api3/catalog/getvideosforcontent', video_id,
+ query={
+ 'contentid': video_id,
+ 'channel': 'byutv',
+ 'x-byutv-context': 'web$US',
+ }, headers={
+ 'x-byutv-context': 'web$US',
+ 'x-byutv-platformkey': 'xsaaw9c7y5',
+ })['ooyalaVOD']
+
+ return {
+ '_type': 'url_transparent',
+ 'ie_key': 'Ooyala',
+ 'url': 'ooyala:%s' % ep['providerId'],
+ 'id': video_id,
+ 'display_id': display_id,
+ 'title': ep.get('title'),
+ 'description': ep.get('description'),
+ 'thumbnail': ep.get('imageThumbnail'),
+ }