]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/nuevo.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
12 class NuevoBaseIE(InfoExtractor
):
13 def _extract_nuevo(self
, config_url
, video_id
, headers
={}):
14 config
= self
._download
_xml
(
15 config_url
, video_id
, transform_source
=lambda s
: s
.strip(),
18 title
= xpath_text(config
, './title', 'title', fatal
=True).strip()
19 video_id
= xpath_text(config
, './mediaid', default
=video_id
)
20 thumbnail
= xpath_text(config
, ['./image', './thumb'])
21 duration
= float_or_none(xpath_text(config
, './duration'))
24 for element_name
, format_id
in (('file', 'sd'), ('filehd', 'hd')):
25 video_url
= xpath_text(config
, element_name
)
29 'format_id': format_id
,
31 self
._check
_formats
(formats
, video_id
)
36 'thumbnail': thumbnail
,