You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
888 B

  1. from __future__ import unicode_literals
  2. from .nuevo import NuevoBaseIE
  3. class AnitubeIE(NuevoBaseIE):
  4. IE_NAME = 'anitube.se'
  5. _VALID_URL = r'https?://(?:www\.)?anitube\.se/video/(?P<id>\d+)'
  6. _TEST = {
  7. 'url': 'http://www.anitube.se/video/36621',
  8. 'md5': '59d0eeae28ea0bc8c05e7af429998d43',
  9. 'info_dict': {
  10. 'id': '36621',
  11. 'ext': 'mp4',
  12. 'title': 'Recorder to Randoseru 01',
  13. 'duration': 180.19,
  14. },
  15. 'skip': 'Blocked in the US',
  16. }
  17. def _real_extract(self, url):
  18. video_id = self._match_id(url)
  19. webpage = self._download_webpage(url, video_id)
  20. key = self._search_regex(
  21. r'src=["\']https?://[^/]+/embed/([A-Za-z0-9_-]+)', webpage, 'key')
  22. return self._extract_nuevo(
  23. 'http://www.anitube.se/nuevo/econfig.php?key=%s' % key, video_id)