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.

27 lines
951 B

  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:65ba37ad619165afac7d432eaded6013',
  14. 'duration': 138,
  15. },
  16. }
  17. def _real_extract(self, url):
  18. video_id = self._match_id(url)
  19. webpage = self._download_webpage(url, video_id)
  20. og_video = self._og_search_video_url(webpage)
  21. query = compat_urlparse.urlparse(og_video).query
  22. return self.url_result(InternetVideoArchiveIE._build_url(query), ie=InternetVideoArchiveIE.ie_key())