]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/anitube.py
   3 from .common 
import InfoExtractor
 
   6 class AnitubeIE(InfoExtractor
): 
   7     IE_NAME 
= u
'anitube.se' 
   8     _VALID_URL 
= r
'https?://(?:www\.)?anitube\.se/video/(?P<id>\d+)' 
  11         u
'url': u
'http://www.anitube.se/video/36621', 
  12         u
'md5': u
'59d0eeae28ea0bc8c05e7af429998d43', 
  13         u
'file': u
'36621.mp4', 
  17             u
'title': u
'Recorder to Randoseru 01', 
  19         u
'skip': u
'Blocked in the US', 
  22     def _real_extract(self
, url
): 
  23         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  24         video_id 
= mobj
.group('id') 
  26         webpage 
= self
._download
_webpage
(url
, video_id
) 
  27         key 
= self
._html
_search
_regex
(r
'http://www\.anitube\.se/embed/([A-Za-z0-9_-]*)', 
  30         config_xml 
= self
._download
_xml
('http://www.anitube.se/nuevo/econfig.php?key=%s' % key
, 
  33         video_title 
= config_xml
.find('title').text
 
  36         video_url 
= config_xml
.find('file') 
  37         if video_url 
is not None: 
  40                 'url': video_url
.text
, 
  42         video_url 
= config_xml
.find('filehd') 
  43         if video_url 
is not None: 
  46                 'url': video_url
.text
,