]>
Commit | Line | Data |
---|---|---|
5aaca50d JMF |
1 | from __future__ import unicode_literals |
2 | ||
2c64df03 PH |
3 | import re |
4 | ||
5 | from .common import InfoExtractor | |
6 | ||
7 | ||
8 | class KeekIE(InfoExtractor): | |
6625f829 | 9 | _VALID_URL = r'https?://(?:www\.)?keek\.com/(?:!|\w+/keeks/)(?P<videoID>\w+)' |
5aaca50d | 10 | IE_NAME = 'keek' |
6f5ac90c | 11 | _TEST = { |
5aaca50d JMF |
12 | 'url': 'https://www.keek.com/ytdl/keeks/NODfbab', |
13 | 'file': 'NODfbab.mp4', | |
14 | 'md5': '9b0636f8c0f7614afa4ea5e4c6e57e83', | |
15 | 'info_dict': { | |
16 | 'uploader': 'ytdl', | |
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): | |
22 | m = re.match(self._VALID_URL, url) | |
23 | video_id = m.group('videoID') | |
24 | ||
5aaca50d JMF |
25 | video_url = 'http://cdn.keek.com/keek/video/%s' % video_id |
26 | thumbnail = 'http://cdn.keek.com/keek/thumbnail/%s/w100/h75' % video_id | |
2c64df03 PH |
27 | webpage = self._download_webpage(url, video_id) |
28 | ||
5aaca50d JMF |
29 | uploader = self._html_search_regex( |
30 | r'<div class="user-name-and-bio">[\S\s]+?<h2>(?P<uploader>.+?)</h2>', | |
31 | webpage, 'uploader', fatal=False) | |
32 | ||
33 | return { | |
34 | 'id': video_id, | |
35 | 'url': video_url, | |
36 | 'ext': 'mp4', | |
37 | 'title': self._og_search_title(webpage), | |
38 | 'thumbnail': thumbnail, | |
39 | 'uploader': uploader | |
2c64df03 | 40 | } |