]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/anitube.py
release 2017.10.01
[yt-dlp.git] / youtube_dl / extractor / anitube.py
CommitLineData
93881db2
S
1from __future__ import unicode_literals
2
d570746e 3from .nuevo import NuevoBaseIE
ba3881df
AL
4
5
d570746e 6class AnitubeIE(NuevoBaseIE):
93881db2 7 IE_NAME = 'anitube.se'
8f053519 8 _VALID_URL = r'https?://(?:www\.)?anitube\.se/video/(?P<id>\d+)'
ba3881df
AL
9
10 _TEST = {
93881db2
S
11 'url': 'http://www.anitube.se/video/36621',
12 'md5': '59d0eeae28ea0bc8c05e7af429998d43',
13 'info_dict': {
14 'id': '36621',
15 'ext': 'mp4',
16 'title': 'Recorder to Randoseru 01',
17 'duration': 180.19,
ba3881df 18 },
93881db2 19 'skip': 'Blocked in the US',
ba3881df
AL
20 }
21
22 def _real_extract(self, url):
10677ece 23 video_id = self._match_id(url)
ba3881df
AL
24
25 webpage = self._download_webpage(url, video_id)
6722ebd4
S
26 key = self._search_regex(
27 r'src=["\']https?://[^/]+/embed/([A-Za-z0-9_-]+)', webpage, 'key')
ba3881df 28
10677ece
S
29 return self._extract_nuevo(
30 'http://www.anitube.se/nuevo/econfig.php?key=%s' % key, video_id)