]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/golem.py
53714f47f1a0a8cd1abb8aab0ec09cdbd283d51b
   2 from __future__ 
import unicode_literals
 
   4 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') 
  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         self
._sort
_formats
(formats
) 
  55         info
['formats'] = formats
 
  58         for e 
in config
.findall('.//teaser'): 
  59             url 
= e
.findtext('./url') 
  63                 'url': compat_urlparse
.urljoin(self
._PREFIX
, url
), 
  64                 'width': self
._int
(e
.get('width'), 'thumbnail width'), 
  65                 'height': self
._int
(e
.get('height'), 'thumbnail height'), 
  67         info
['thumbnails'] = thumbnails