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.

29 lines
984 B

  1. import re
  2. from .common import InfoExtractor
  3. class VidziIE(InfoExtractor):
  4. _VALID_URL = r'https?://(?:www\.)?vidzi\.tv/(?P<id>\w+)'
  5. _TEST = {
  6. 'url': 'http://vidzi.tv/m1chxrwq7bx9',
  7. 'md5': '5c4c4a8ca2281a199c8eefe8f411d630',
  8. 'info_dict': {
  9. 'id': 'm1chxrwq7bx9',
  10. 'ext': 'mp4',
  11. 'title': 'Watch Cadbury Dream Factory S01E04 HDTV x264 FiHTV mp4',
  12. },
  13. }
  14. def _real_extract(self, url):
  15. mobj = re.match(self._VALID_URL, url)
  16. video_id = mobj.group('id')
  17. webpage = self._download_webpage('http://vidzi.tv/' + video_id, video_id)
  18. video_url = self._html_search_regex(r'{\s*file\s*:\s*"([^"]+)"\s*}', webpage, u'vidzi url')
  19. title = self._html_search_regex(r'<Title>([^<]+)<\/Title>', webpage, u'vidzi title')
  20. return {
  21. 'id': video_id,
  22. 'title': title,
  23. 'url': video_url,
  24. 'ext': 'mp4',
  25. }