2 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 class RteIE(InfoExtractor):
12 _VALID_URL = r'https?://(?:www\.)?rte\.ie/player/[^/]{2,3}/show/[^/]+/(?P<id>[0-9]+)'
14 'url': 'http://www.rte.ie/player/ie/show/iwitness-862/10478715/',
18 'title': 'Watch iWitness online',
19 'thumbnail': 're:^https?://.*\.jpg$',
20 'description': 'iWitness : The spirit of Ireland, one voice and one minute at a time.',
24 'skip_download': 'f4m fails with --test atm'
28 def _real_extract(self, url):
29 video_id = self._match_id(url)
30 webpage = self._download_webpage(url, video_id)
32 title = self._og_search_title(webpage)
33 description = self._html_search_meta('description', webpage, 'description')
34 duration = float_or_none(self._html_search_meta(
35 'duration', webpage, 'duration', fatal=False), 1000)
37 thumbnail_id = self._search_regex(
38 r'<meta name="thumbnail" content="uri:irus:(.*?)" />', webpage, 'thumbnail')
39 thumbnail = 'http://img.rasset.ie/' + thumbnail_id + '.jpg'
41 feeds_url = self._html_search_meta("feeds-prefix", webpage, 'feeds url') + video_id
42 json_string = self._download_json(feeds_url, video_id)
44 # f4m_url = server + relative_url
45 f4m_url = json_string['shows'][0]['media:group'][0]['rte:server'] + json_string['shows'][0]['media:group'][0]['url']
46 f4m_formats = self._extract_f4m_formats(f4m_url, video_id)
48 'format_id': f['format_id'],
52 'height': f['height'],
53 } for f in f4m_formats]
58 'formats': f4m_formats,
59 'description': description,
60 'thumbnail': thumbnail,