]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/golem.py
2bfb9904022c6a3830901baa2ee380b6f4f14714
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
13 class GolemIE(InfoExtractor
):
14 _VALID_URL
= r
'^https?://video\.golem\.de/.+?/(?P<id>.+?)/'
16 'url': 'http://video.golem.de/handy/14095/iphone-6-und-6-plus-test.html',
17 'md5': 'c1a2c0a3c863319651c7c992c5ee29bf',
22 'title': 'iPhone 6 und 6 Plus - Test',
28 _PREFIX
= 'http://video.golem.de'
30 def _real_extract(self
, url
):
31 video_id
= self
._match
_id
(url
)
33 config
= self
._download
_xml
(
34 'https://video.golem.de/xml/{0}.xml'.format(video_id
), video_id
)
38 'title': config
.findtext('./title', 'golem'),
39 'duration': self
._float
(config
.findtext('./playtime'), 'duration'),
44 url
= e
.findtext('./url')
50 'url': compat_urlparse
.urljoin(self
._PREFIX
, url
),
51 'height': self
._int
(e
.get('height'), 'height'),
52 'width': self
._int
(e
.get('width'), 'width'),
53 'filesize': self
._int
(e
.findtext('filesize'), 'filesize'),
54 'ext': determine_ext(e
.findtext('./filename')),
56 self
._sort
_formats
(formats
)
57 info
['formats'] = formats
60 for e
in config
.findall('.//teaser'):
61 url
= e
.findtext('./url')
65 'url': compat_urlparse
.urljoin(self
._PREFIX
, url
),
66 'width': self
._int
(e
.get('width'), 'thumbnail width'),
67 'height': self
._int
(e
.get('height'), 'thumbnail height'),
69 info
['thumbnails'] = thumbnails