]>
Commit | Line | Data |
---|---|---|
2250865f PH |
1 | from __future__ import unicode_literals |
2 | ||
405ec05c | 3 | import re |
ed92bc9f | 4 | |
405ec05c YK |
5 | from .common import InfoExtractor |
6 | ||
7 | ||
8 | class WimpIE(InfoExtractor): | |
9 | _VALID_URL = r'(?:http://)?(?:www\.)?wimp\.com/([^/]+)/' | |
6f5ac90c | 10 | _TEST = { |
2250865f PH |
11 | 'url': 'http://www.wimp.com/deerfence/', |
12 | 'file': 'deerfence.flv', | |
13 | 'md5': '8b215e2e0168c6081a1cf84b2846a2b5', | |
14 | 'info_dict': { | |
15 | "title": "Watch Till End: Herd of deer jump over a fence.", | |
16 | "description": "These deer look as fluid as running water when they jump over this fence as a herd. This video is one that needs to be watched until the very end for the true majesty to be witnessed, but once it comes, it's sure to take your breath away.", | |
6f5ac90c PH |
17 | } |
18 | } | |
405ec05c YK |
19 | |
20 | def _real_extract(self, url): | |
21 | mobj = re.match(self._VALID_URL, url) | |
22 | video_id = mobj.group(1) | |
23 | webpage = self._download_webpage(url, video_id) | |
2250865f PH |
24 | video_url = self._search_regex( |
25 | r's1\.addVariable\("file",\s*"([^"]+)"\);', webpage, 'video URL') | |
5abeaf06 | 26 | |
11bf8481 PH |
27 | return { |
28 | 'id': video_id, | |
2250865f | 29 | 'url': video_url, |
11bf8481 PH |
30 | 'title': self._og_search_title(webpage), |
31 | 'thumbnail': self._og_search_thumbnail(webpage), | |
32 | 'description': self._og_search_description(webpage), | |
33 | } |