]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/anitube.py
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',
20 u
'skip': u
'Blocked in the US',
23 def _real_extract(self
, url
):
24 mobj
= re
.match(self
._VALID
_URL
, url
)
25 video_id
= mobj
.group('id')
27 webpage
= self
._download
_webpage
(url
, video_id
)
28 key
= self
._html
_search
_regex
(r
'http://www\.anitube\.se/embed/([A-Za-z0-9_-]*)',
31 webpage_config
= self
._download
_webpage
('http://www.anitube.se/nuevo/econfig.php?key=%s' % key
,
33 config_xml
= xml
.etree
.ElementTree
.fromstring(webpage_config
.encode('utf-8'))
35 video_title
= config_xml
.find('title').text
38 video_url
= config_xml
.find('file')
39 if video_url
is not None:
42 'url': video_url
.text
,
44 video_url
= config_xml
.find('filehd')
45 if video_url
is not None:
48 'url': video_url
.text
,