]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/anitube.py
23f942ae2d039cf92c9a67934a07d3062f744b0d
   1 from __future__ 
import unicode_literals
 
   5 from .common 
import InfoExtractor
 
   8 class AnitubeIE(InfoExtractor
): 
  10     _VALID_URL 
= r
'https?://(?:www\.)?anitube\.se/video/(?P<id>\d+)' 
  13         'url': 'http://www.anitube.se/video/36621', 
  14         'md5': '59d0eeae28ea0bc8c05e7af429998d43', 
  18             'title': 'Recorder to Randoseru 01', 
  21         'skip': 'Blocked in the US', 
  24     def _real_extract(self
, url
): 
  25         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  26         video_id 
= mobj
.group('id') 
  28         webpage 
= self
._download
_webpage
(url
, video_id
) 
  29         key 
= self
._search
_regex
( 
  30             r
'src=["\']https?
://[^
/]+/embed
/([A
-Za
-z0
-9_-]+)', webpage, 'key
') 
  32         config_xml = self._download_xml( 
  33             'http
://www
.anitube
.se
/nuevo
/econfig
.php?key
=%s' % key, key) 
  35         video_title = config_xml.find('title
').text 
  36         thumbnail = config_xml.find('image
').text 
  37         duration = float(config_xml.find('duration
').text) 
  40         video_url = config_xml.find('file') 
  41         if video_url is not None: 
  44                 'url
': video_url.text, 
  46         video_url = config_xml.find('filehd
') 
  47         if video_url is not None: 
  50                 'url
': video_url.text, 
  56             'thumbnail
': thumbnail,