]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/vrak.py
3 from .common
import InfoExtractor
4 from .brightcove
import BrightcoveNewIE
13 class VrakIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://(?:www\.)?vrak\.tv/videos\?.*?\btarget=(?P<id>[\d.]+)'
16 'url': 'http://www.vrak.tv/videos?target=1.2306782&filtre=emission&id=1.1806721',
18 'id': '5345661243001',
20 'title': 'Obésité, film de hockey et Roseline Filion',
21 'timestamp': 1488492126,
22 'upload_date': '20170302',
23 'uploader_id': '2890187628001',
26 'series': 'ALT (Actualité Légèrement Tordue)',
27 'episode': 'Obésité, film de hockey et Roseline Filion',
31 'skip_download': True,
34 BRIGHTCOVE_URL_TEMPLATE
= 'http://players.brightcove.net/2890187628001/default_default/index.html?videoId=%s'
36 def _real_extract(self
, url
):
37 video_id
= self
._match
_id
(url
)
39 webpage
= self
._download
_webpage
(url
, video_id
)
41 title
= self
._html
_search
_regex
(
42 r
'<h\d\b[^>]+\bclass=["\']videoTitle
["\'][^>]*>([^<]+)',
43 webpage, 'title', default=None) or self._og_search_title(webpage)
45 content = self._parse_json(
47 r'data-player-options-content=(["\'])(?P
<content
>{.+?}
)\
1',
48 webpage, 'content
', default='{}', group='content
'),
49 video_id, transform_source=unescapeHTML)
51 ref_id = content.get('refId
') or self._search_regex(
52 r'refId
"
;:"
;([^
&]+)"
;', webpage, 'ref
id')
54 brightcove_id = self._search_regex(
56 java\.lang\.String\s+value\s*=\s*["']brightcove\
.article\
.\d
+\
.%s
58 java\
.lang\
.String\s
+value\s
*=\s
*["'](\d+)
59 ''' % re.escape(ref_id), webpage, 'brightcove id')
62 '_type': 'url_transparent',
63 'ie_key': BrightcoveNewIE.ie_key(),
65 self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id,
66 {'geo_countries': ['CA']}),
68 'description': content.get('description'),
69 'creator': content.get('brand'),
70 'age_limit': parse_age_limit(content.get('rating')),
71 'series': content.get('showName') or content.get(
72 'episodeName'), # this is intentional
73 'season_number': int_or_none(content.get('seasonNumber')),
75 'episode_number': int_or_none(content.get('episodeNumber')),
76 'tags': content.get('tags', []),