[youtube] Fix extraction.
[youtube-dl] / youtube_dl / extractor / videodetective.py
1 from __future__ import unicode_literals
2
3 from .common import InfoExtractor
4 from .internetvideoarchive import InternetVideoArchiveIE
5
6
7 class VideoDetectiveIE(InfoExtractor):
8     _VALID_URL = r'https?://(?:www\.)?videodetective\.com/[^/]+/[^/]+/(?P<id>\d+)'
9
10     _TEST = {
11         'url': 'http://www.videodetective.com/movies/kick-ass-2/194487',
12         'info_dict': {
13             'id': '194487',
14             'ext': 'mp4',
15             'title': 'Kick-Ass 2',
16             'description': 'md5:c189d5b7280400630a1d3dd17eaa8d8a',
17         },
18         'params': {
19             # m3u8 download
20             'skip_download': True,
21         },
22     }
23
24     def _real_extract(self, url):
25         video_id = self._match_id(url)
26         query = 'customerid=69249&publishedid=' + video_id
27         return self.url_result(
28             InternetVideoArchiveIE._build_json_url(query),
29             ie=InternetVideoArchiveIE.ie_key())