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.

32 lines
944 B

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class VidziIE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:www\.)?vidzi\.tv/(?P<id>\w+)'
  6. _TEST = {
  7. 'url': 'http://vidzi.tv/cghql9yq6emu.html',
  8. 'md5': '4f16c71ca0c8c8635ab6932b5f3f1660',
  9. 'info_dict': {
  10. 'id': 'cghql9yq6emu',
  11. 'ext': 'mp4',
  12. 'title': 'youtube-dl test video 1\\\\2\'3/4<5\\\\6ä7↭',
  13. },
  14. }
  15. def _real_extract(self, url):
  16. video_id = self._match_id(url)
  17. webpage = self._download_webpage(url, video_id)
  18. video_url = self._html_search_regex(
  19. r'{\s*file\s*:\s*"([^"]+)"\s*}', webpage, 'video url')
  20. title = self._html_search_regex(
  21. r'(?s)<h2 class="video-title">(.*?)</h2>', webpage, 'title')
  22. return {
  23. 'id': video_id,
  24. 'title': title,
  25. 'url': video_url,
  26. }