3 from .common
import InfoExtractor
9 class GolemIE(InfoExtractor
):
10 _VALID_URL
= r
'^https?://video\.golem\.de/.+?/(?P<id>.+?)/'
12 'url': 'http://video.golem.de/handy/14095/iphone-6-und-6-plus-test.html',
13 'md5': 'c1a2c0a3c863319651c7c992c5ee29bf',
18 'title': 'iPhone 6 und 6 Plus - Test',
24 _PREFIX
= 'http://video.golem.de'
26 def _real_extract(self
, url
):
27 video_id
= self
._match
_id
(url
)
29 config
= self
._download
_xml
(
30 f
'https://video.golem.de/xml/{video_id}.xml', video_id
)
34 'title': config
.findtext('./title', 'golem'),
35 'duration': self
._float
(config
.findtext('./playtime'), 'duration'),
40 url
= e
.findtext('./url')
45 'format_id': str(e
.tag
),
46 'url': urllib
.parse
.urljoin(self
._PREFIX
, url
),
47 'height': self
._int
(e
.get('height'), 'height'),
48 'width': self
._int
(e
.get('width'), 'width'),
49 'filesize': self
._int
(e
.findtext('filesize'), 'filesize'),
50 'ext': determine_ext(e
.findtext('./filename')),
52 info
['formats'] = formats
55 for e
in config
.findall('.//teaser'):
56 url
= e
.findtext('./url')
60 'url': urllib
.parse
.urljoin(self
._PREFIX
, url
),
61 'width': self
._int
(e
.get('width'), 'thumbnail width'),
62 'height': self
._int
(e
.get('height'), 'thumbnail height'),
64 info
['thumbnails'] = thumbnails