1 from .common
import InfoExtractor
11 class GolemIE(InfoExtractor
):
12 _VALID_URL
= r
'^https?://video\.golem\.de/.+?/(?P<id>.+?)/'
14 'url': 'http://video.golem.de/handy/14095/iphone-6-und-6-plus-test.html',
15 'md5': 'c1a2c0a3c863319651c7c992c5ee29bf',
20 'title': 'iPhone 6 und 6 Plus - Test',
26 _PREFIX
= 'http://video.golem.de'
28 def _real_extract(self
, url
):
29 video_id
= self
._match
_id
(url
)
31 config
= self
._download
_xml
(
32 'https://video.golem.de/xml/{0}.xml'.format(video_id
), video_id
)
36 'title': config
.findtext('./title', 'golem'),
37 'duration': self
._float
(config
.findtext('./playtime'), 'duration'),
42 url
= e
.findtext('./url')
47 'format_id': compat_str(e
.tag
),
48 'url': compat_urlparse
.urljoin(self
._PREFIX
, url
),
49 'height': self
._int
(e
.get('height'), 'height'),
50 'width': self
._int
(e
.get('width'), 'width'),
51 'filesize': self
._int
(e
.findtext('filesize'), 'filesize'),
52 'ext': determine_ext(e
.findtext('./filename')),
54 info
['formats'] = formats
57 for e
in config
.findall('.//teaser'):
58 url
= e
.findtext('./url')
62 'url': compat_urlparse
.urljoin(self
._PREFIX
, url
),
63 'width': self
._int
(e
.get('width'), 'thumbnail width'),
64 'height': self
._int
(e
.get('height'), 'thumbnail height'),
66 info
['thumbnails'] = thumbnails