vidzi.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. from ..utils import smuggle_url
  5. class VidziIE(InfoExtractor):
  6. _VALID_URL = r'https?://(?:www\.)?vidzi\.tv/(?P<id>\w+)'
  7. _TEST = {
  8. 'url': 'http://vidzi.tv/cghql9yq6emu.html',
  9. 'md5': '4f16c71ca0c8c8635ab6932b5f3f1660',
  10. 'info_dict': {
  11. 'id': 'cghql9yq6emu',
  12. 'ext': 'mp4',
  13. 'title': 'youtube-dl test video 1\\\\2\'3/4<5\\\\6ä7↭',
  14. 'uploader': 'vidzi.tv',
  15. },
  16. 'params': {
  17. # m3u8 download
  18. 'skip_download': True,
  19. },
  20. }
  21. def _real_extract(self, url):
  22. video_id = self._match_id(url)
  23. webpage = self._download_webpage(url, video_id)
  24. title = self._html_search_regex(
  25. r'(?s)<h2 class="video-title">(.*?)</h2>', webpage, 'title')
  26. # Vidzi now uses jwplayer, which can be handled by GenericIE
  27. return {
  28. '_type': 'url_transparent',
  29. 'id': video_id,
  30. 'title': title,
  31. 'url': smuggle_url(url, {'to_generic': True}),
  32. 'ie_key': 'Generic',
  33. }