]>
Commit | Line | Data |
---|---|---|
2c64df03 PH |
1 | import re |
2 | ||
3 | from .common import InfoExtractor | |
4 | ||
5 | ||
6 | class KeekIE(InfoExtractor): | |
7 | _VALID_URL = r'http://(?:www\.)?keek\.com/(?:!|\w+/keeks/)(?P<videoID>\w+)' | |
8 | IE_NAME = u'keek' | |
6f5ac90c PH |
9 | _TEST = { |
10 | u'url': u'http://www.keek.com/ytdl/keeks/NODfbab', | |
11 | u'file': u'NODfbab.mp4', | |
12 | u'md5': u'9b0636f8c0f7614afa4ea5e4c6e57e83', | |
13 | u'info_dict': { | |
14 | u"uploader": u"ytdl", | |
15 | u"title": u"test chars: \"'/\\\u00e4<>This is a test video for youtube-dl.For more information, contact phihag@phihag.de ." | |
16 | } | |
17 | } | |
2c64df03 PH |
18 | |
19 | def _real_extract(self, url): | |
20 | m = re.match(self._VALID_URL, url) | |
21 | video_id = m.group('videoID') | |
22 | ||
23 | video_url = u'http://cdn.keek.com/keek/video/%s' % video_id | |
24 | thumbnail = u'http://cdn.keek.com/keek/thumbnail/%s/w100/h75' % video_id | |
25 | webpage = self._download_webpage(url, video_id) | |
26 | ||
27 | video_title = self._html_search_regex(r'<meta property="og:title" content="(?P<title>.*?)"', | |
28 | webpage, u'title') | |
29 | ||
30 | uploader = self._html_search_regex(r'<div class="user-name-and-bio">[\S\s]+?<h2>(?P<uploader>.+?)</h2>', | |
31 | webpage, u'uploader', fatal=False) | |
32 | ||
33 | info = { | |
34 | 'id': video_id, | |
35 | 'url': video_url, | |
36 | 'ext': 'mp4', | |
37 | 'title': video_title, | |
38 | 'thumbnail': thumbnail, | |
39 | 'uploader': uploader | |
40 | } | |
41 | return [info] |