]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/byutv.py
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
8 class BYUtvIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?byutv\.org/(?:watch|player)/(?!event/)(?P<id>[0-9a-f-]+)(?:/(?P<display_id>[^/?#&]+))?'
11 'url': 'http://www.byutv.org/watch/6587b9a3-89d2-42a6-a7f7-fd2f81840a7d/studio-c-season-5-episode-5',
13 'id': 'ZvanRocTpW-G5_yZFeltTAMv6jxOU9KH',
14 'display_id': 'studio-c-season-5-episode-5',
16 'title': 'Season 5 Episode 5',
17 'description': 'md5:1d31dc18ef4f075b28f6a65937d22c65',
18 'thumbnail': r
're:^https?://.*',
22 'skip_download': True,
26 'url': 'http://www.byutv.org/watch/6587b9a3-89d2-42a6-a7f7-fd2f81840a7d',
27 'only_matching': True,
29 'url': 'https://www.byutv.org/player/27741493-dc83-40b0-8420-e7ae38a2ae98/byu-football-toledo-vs-byu-93016?listid=4fe0fee5-0d3c-4a29-b725-e4948627f472&listindex=0&q=toledo',
30 'only_matching': True,
33 def _real_extract(self
, url
):
34 mobj
= re
.match(self
._VALID
_URL
, url
)
35 video_id
= mobj
.group('id')
36 display_id
= mobj
.group('display_id') or video_id
38 ep
= self
._download
_json
(
39 'https://api.byutv.org/api3/catalog/getvideosforcontent', video_id
,
41 'contentid': video_id
,
43 'x-byutv-context': 'web$US',
45 'x-byutv-context': 'web$US',
46 'x-byutv-platformkey': 'xsaaw9c7y5',
50 '_type': 'url_transparent',
52 'url': 'ooyala:%s' % ep
['providerId'],
54 'display_id': display_id
,
55 'title': ep
.get('title'),
56 'description': ep
.get('description'),
57 'thumbnail': ep
.get('imageThumbnail'),