]>
Raphaƫl G. Git Repositories - youtubedl/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/[^/]{2,3}/show/(?P<id>[0-9]+)/' 
  14         'url': 'http://www.rte.ie/player/de/show/10363114/', 
  19             'thumbnail': 're:^https?://.*\.jpg$', 
  20             'description': 'The One O\'Clock News followed by Weather.', 
  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
_f
4m
_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
,