]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/rte.py
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.',
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'), 1000)
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
_f
4m
_formats
(f4m_url
, video_id
)
44 'format_id': f
['format_id'],
48 'height': f
['height'],
49 } for f
in f4m_formats
]
54 'formats': f4m_formats
,
55 'description': description
,
56 'thumbnail': thumbnail
,