2 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 class RteIE(InfoExtractor):
12 _VALID_URL = r'http?://(?:www\.)?rte\.ie/player/in/show/(?P<id>[0-9]+)/'
14 'url': 'http://www.rte.ie/player/in/show/10336191/',
19 'thumbnail': 're:^https?://.*\.jpg$',
20 'description': 'The One O\'Clock News followed by Weather.',
21 'duration': 1622963.0,
25 def _real_extract(self, url):
26 video_id = self._match_id(url)
28 webpage = self._download_webpage(url, video_id)
29 title = self._og_search_title(webpage)
31 description = self._search_regex(r'<meta name="description" content="(.*?)" />', webpage, 'description')
32 duration = float_or_none(self._html_search_meta('duration', webpage, 'duration'))
34 thumbnail_id = self._search_regex(r'<meta name="thumbnail" content="uri:irus:(.*?)" />', webpage, 'thumbnail')
35 thumbnail = 'http://img.rasset.ie/' + thumbnail_id + '.jpg'
37 feeds_url = self._html_search_meta("feeds-prefix", webpage, 'feeds url') + video_id
38 json_string = self._download_json(feeds_url, video_id)
40 # f4m_url = server + relative_url
41 f4m_url = json_string['shows'][0]['media:group'][0]['rte:server'] + json_string['shows'][0]['media:group'][0]['url']
42 f4m_formats = self._extract_f4m_formats(f4m_url, video_id)
49 'formats': f4m_formats,
50 'description': description,
51 'thumbnail': thumbnail,