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
1.0 KiB

  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. from ..compat import compat_urlparse
  4. from .internetvideoarchive import InternetVideoArchiveIE
  5. class VideoDetectiveIE(InfoExtractor):
  6. _VALID_URL = r'https?://(?:www\.)?videodetective\.com/[^/]+/[^/]+/(?P<id>\d+)'
  7. _TEST = {
  8. 'url': 'http://www.videodetective.com/movies/kick-ass-2/194487',
  9. 'info_dict': {
  10. 'id': '194487',
  11. 'ext': 'mp4',
  12. 'title': 'KICK-ASS 2',
  13. 'description': 'md5:c189d5b7280400630a1d3dd17eaa8d8a',
  14. },
  15. 'params': {
  16. # m3u8 download
  17. 'skip_download': True,
  18. },
  19. }
  20. def _real_extract(self, url):
  21. video_id = self._match_id(url)
  22. webpage = self._download_webpage(url, video_id)
  23. og_video = self._og_search_video_url(webpage)
  24. query = compat_urlparse.urlparse(og_video).query
  25. return self.url_result(InternetVideoArchiveIE._build_json_url(query), ie=InternetVideoArchiveIE.ie_key())