2 import xml.etree.ElementTree
4 from .common import InfoExtractor
7 class AnitubeIE(InfoExtractor):
8 IE_NAME = u'anitube.se'
9 _VALID_URL = r'https?://(?:www\.)?anitube\.se/video/(?P<id>\d+)'
12 u'url': u'http://www.anitube.se/video/36621',
13 u'md5': u'59d0eeae28ea0bc8c05e7af429998d43',
14 u'file': u'36621.mp4',
18 u'title': u'Recorder to Randoseru 01',
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 webpage_config = self._download_webpage('http://www.anitube.se/nuevo/econfig.php?key=%s' % key,
32 config_xml = xml.etree.ElementTree.fromstring(webpage_config.encode('utf-8'))
34 video_title = config_xml.find('title').text
37 video_url = config_xml.find('file')
38 if video_url is not None:
41 'url': video_url.text,
43 video_url = config_xml.find('filehd')
44 if video_url is not None:
47 'url': video_url.text,