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