]>
Commit | Line | Data |
---|---|---|
5aaca50d JMF |
1 | from __future__ import unicode_literals |
2 | ||
2c64df03 PH |
3 | from .common import InfoExtractor |
4 | ||
5 | ||
6 | class KeekIE(InfoExtractor): | |
7129bed5 | 7 | _VALID_URL = r'https?://(?:www\.)?keek\.com/(?:!|\w+/keeks/)(?P<id>\w+)' |
5aaca50d | 8 | IE_NAME = 'keek' |
6f5ac90c | 9 | _TEST = { |
5aaca50d | 10 | 'url': 'https://www.keek.com/ytdl/keeks/NODfbab', |
7129bed5 | 11 | 'md5': '09c5c109067536c1cec8bac8c21fea05', |
5aaca50d | 12 | 'info_dict': { |
7129bed5 PH |
13 | 'id': 'NODfbab', |
14 | 'ext': 'mp4', | |
15 | 'uploader': 'youtube-dl project', | |
16 | 'uploader_id': 'ytdl', | |
5aaca50d JMF |
17 | 'title': 'test chars: "\'/\\\u00e4<>This is a test video for youtube-dl.For more information, contact phihag@phihag.de .', |
18 | }, | |
6f5ac90c | 19 | } |
2c64df03 PH |
20 | |
21 | def _real_extract(self, url): | |
7129bed5 | 22 | video_id = self._match_id(url) |
2c64df03 | 23 | |
5aaca50d JMF |
24 | video_url = 'http://cdn.keek.com/keek/video/%s' % video_id |
25 | thumbnail = 'http://cdn.keek.com/keek/thumbnail/%s/w100/h75' % video_id | |
2c64df03 PH |
26 | webpage = self._download_webpage(url, video_id) |
27 | ||
7129bed5 PH |
28 | raw_desc = self._html_search_meta('description', webpage) |
29 | if raw_desc: | |
30 | uploader = self._html_search_regex( | |
31 | r'Watch (.*?)\s+\(', raw_desc, 'uploader', fatal=False) | |
32 | uploader_id = self._html_search_regex( | |
33 | r'Watch .*?\(@(.+?)\)', raw_desc, 'uploader_id', fatal=False) | |
34 | else: | |
35 | uploader = None | |
36 | uploader_id = None | |
5aaca50d JMF |
37 | |
38 | return { | |
39 | 'id': video_id, | |
40 | 'url': video_url, | |
41 | 'ext': 'mp4', | |
42 | 'title': self._og_search_title(webpage), | |
43 | 'thumbnail': thumbnail, | |
7129bed5 PH |
44 | 'uploader': uploader, |
45 | 'uploader_id': uploader_id, | |
2c64df03 | 46 | } |