]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/byutv.py
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
6 from ..utils
import ExtractorError
9 class BYUtvIE(InfoExtractor
):
10 _VALID_URL
= r
'^https?://(?:www\.)?byutv.org/watch/[0-9a-f-]+/(?P<id>[^/?#]+)'
12 'url': 'http://www.byutv.org/watch/6587b9a3-89d2-42a6-a7f7-fd2f81840a7d/studio-c-season-5-episode-5',
13 'md5': '05850eb8c749e2ee05ad5a1c34668493',
15 'id': 'studio-c-season-5-episode-5',
17 'description': 'md5:e07269172baff037f8e8bf9956bc9747',
18 'title': 'Season 5 Episode 5',
19 'thumbnail': 're:^https?://.*\.jpg$',
23 'skip_download': True,
28 def _real_extract(self
, url
):
29 video_id
= self
._match
_id
(url
)
31 webpage
= self
._download
_webpage
(url
, video_id
)
32 episode_code
= self
._search
_regex
(
33 r
'(?s)episode:(.*?\}),\s*\n', webpage
, 'episode information')
35 ep
= self
._parse
_json
(
36 episode_code
, video_id
, transform_source
=lambda s
:
37 re
.sub(r
'(\n\s+)([a-zA-Z]+):\s+\'(.*?
)\'', r'\
1"\2": "\3"', s))
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
'])