1 from __future__ import unicode_literals
6 from .common import InfoExtractor
12 class BYUtvIE(InfoExtractor):
13 _VALID_URL = r'^https?://(?:www\.)?byutv.org/watch/[0-9a-f-]+/(?P<video_id>[^/?#]+)'
15 'url': 'http://www.byutv.org/watch/44e80f7b-e3ba-43ba-8c51-b1fd96c94a79/granite-flats-talking',
17 'id': 'granite-flats-talking',
19 'description': 'md5:1a7ae3e153359b7cc355ef3963441e5f',
21 'thumbnail': 're:^https?://.*promo.*'
24 'skip_download': True,
28 def _real_extract(self, url):
29 mobj = re.match(self._VALID_URL, url)
30 video_id = mobj.group('video_id')
32 webpage = self._download_webpage(url, video_id)
33 episode_code = self._search_regex(
34 r'(?s)episode:(.*?\}),\s*\n', webpage, 'episode information')
35 episode_json = re.sub(
36 r'(\n\s+)([a-zA-Z]+):\s+\'(.*?)\'', r'\1"\2": "\3"', episode_code)
37 ep = json.loads(episode_json)
39 if ep['providerType'] == 'Ooyala':
41 '_type': 'url_transparent',
43 'url': 'ooyala:%s' % ep['providerId'],
46 'description': ep.get('description'),
47 'thumbnail': ep.get('imageThumbnail'),
50 raise ExtractorError('Unsupported provider %s' % ep['provider'])