]> jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/keek.py
[keek] extract more info
[yt-dlp.git] / youtube_dl / extractor / keek.py
1 from __future__ import unicode_literals
2
3 import re
4
5 from .common import InfoExtractor
6
7
8 class KeekIE(InfoExtractor):
9 _VALID_URL = r'https?://(?:www\.)?keek\.com/keek/(?P<id>\w+)'
10 IE_NAME = 'keek'
11 _TEST = {
12 'url': 'https://www.keek.com/keek/NODfbab',
13 'md5': '9b0636f8c0f7614afa4ea5e4c6e57e83',
14 'info_dict': {
15 'id': 'NODfbab',
16 'ext': 'mp4',
17 'title': 'test chars: "\'/\\ä<>This is a test video for youtube-dl.For more information, contact phihag@phihag.de . - Video - Videos on Keek',
18 'description': 'test chars: "\'/\\ä<>This is a test video for youtube-dl.For more information, contact phihag@phihag.de .',
19 'uploader': 'ytdl',
20 'uploader_id': 'eGT5bab',
21 },
22 }
23
24 def _real_extract(self, url):
25 video_id = self._match_id(url)
26
27 webpage = self._download_webpage(url, video_id)
28 uploader = uploader_id = None
29 matches = re.search(r'data-username="(?P<uploader>[^"]+)"[^>]*data-user-id="(?P<uploader_id>[^"]+)"', webpage)
30 if matches:
31 uploader, uploader_id = matches.groups()
32
33 return {
34 'id': video_id,
35 'url': self._og_search_video_url(webpage),
36 'ext': 'mp4',
37 'title': self._og_search_title(webpage),
38 'description': self._og_search_description(webpage),
39 'thumbnail': self._og_search_thumbnail(webpage),
40 'uploader': uploader,
41 'uploader_id': uploader_id,
42 }