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
970 B

  1. import re
  2. from .common import InfoExtractor
  3. from .internetvideoarchive import InternetVideoArchiveIE
  4. from ..utils import (
  5. compat_urlparse,
  6. )
  7. class VideoDetectiveIE(InfoExtractor):
  8. _VALID_URL = r'https?://www\.videodetective\.com/[^/]+/[^/]+/(?P<id>\d+)'
  9. _TEST = {
  10. u'url': u'http://www.videodetective.com/movies/kick-ass-2/194487',
  11. u'file': u'194487.mp4',
  12. u'info_dict': {
  13. u'title': u'KICK-ASS 2',
  14. u'description': u'md5:65ba37ad619165afac7d432eaded6013',
  15. u'duration': 138,
  16. },
  17. }
  18. def _real_extract(self, url):
  19. mobj = re.match(self._VALID_URL, url)
  20. video_id = mobj.group('id')
  21. webpage = self._download_webpage(url, video_id)
  22. og_video = self._og_search_video_url(webpage)
  23. query = compat_urlparse.urlparse(og_video).query
  24. return self.url_result(InternetVideoArchiveIE._build_url(query),
  25. ie=InternetVideoArchiveIE.ie_key())