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