]>
Commit | Line | Data |
---|---|---|
fdc21836 RA |
1 | from .common import InfoExtractor |
2 | ||
3 | ||
4 | class NRLTVIE(InfoExtractor): | |
5 | _VALID_URL = r'https?://(?:www\.)?nrl\.com/tv(/[^/]+)*/(?P<id>[^/?&#]+)' | |
6 | _TEST = { | |
7 | 'url': 'https://www.nrl.com/tv/news/match-highlights-titans-v-knights-862805/', | |
8 | 'info_dict': { | |
9 | 'id': 'YyNnFuaDE6kPJqlDhG4CGQ_w89mKTau4', | |
10 | 'ext': 'mp4', | |
11 | 'title': 'Match Highlights: Titans v Knights', | |
12 | }, | |
13 | 'params': { | |
14 | # m3u8 download | |
15 | 'skip_download': True, | |
fdc21836 RA |
16 | }, |
17 | } | |
18 | ||
19 | def _real_extract(self, url): | |
20 | display_id = self._match_id(url) | |
21 | webpage = self._download_webpage(url, display_id) | |
12cc8912 RA |
22 | q_data = self._parse_json(self._html_search_regex( |
23 | r'(?s)q-data="({.+?})"', webpage, 'player data'), display_id) | |
fdc21836 RA |
24 | ooyala_id = q_data['videoId'] |
25 | return self.url_result( | |
26 | 'ooyala:' + ooyala_id, 'Ooyala', ooyala_id, q_data.get('title')) |