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