1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-21 15:45:36 +08:00
youtube-dl/youtube_dl/extractor/keek.py

40 lines
1.3 KiB
Python
Raw Normal View History

2015-09-27 02:07:18 +08:00
# coding: utf-8
from __future__ import unicode_literals
2013-06-24 04:16:41 +08:00
from .common import InfoExtractor
class KeekIE(InfoExtractor):
2015-09-25 05:38:00 +08:00
_VALID_URL = r'https?://(?:www\.)?keek\.com/keek/(?P<id>\w+)'
IE_NAME = 'keek'
2013-06-28 02:46:46 +08:00
_TEST = {
2015-09-25 05:38:00 +08:00
'url': 'https://www.keek.com/keek/NODfbab',
'md5': '9b0636f8c0f7614afa4ea5e4c6e57e83',
'info_dict': {
2014-12-13 19:35:13 +08:00
'id': 'NODfbab',
'ext': 'mp4',
'title': 'md5:35d42050a3ece241d5ddd7fdcc6fd896',
2015-09-27 01:04:25 +08:00
'uploader': 'ytdl',
'uploader_id': 'eGT5bab',
},
2013-06-28 02:46:46 +08:00
}
2013-06-24 04:16:41 +08:00
def _real_extract(self, url):
2014-12-13 19:35:13 +08:00
video_id = self._match_id(url)
2013-06-24 04:16:41 +08:00
webpage = self._download_webpage(url, video_id)
return {
'id': video_id,
2015-09-25 05:38:00 +08:00
'url': self._og_search_video_url(webpage),
'ext': 'mp4',
2015-09-28 03:17:28 +08:00
'title': self._og_search_description(webpage).strip(),
2015-09-25 05:38:00 +08:00
'thumbnail': self._og_search_thumbnail(webpage),
2015-09-28 03:15:13 +08:00
'uploader': self._search_regex(
r'data-username=(["\'])(?P<uploader>.+?)\1', webpage,
'uploader', fatal=False, group='uploader'),
'uploader_id': self._search_regex(
r'data-user-id=(["\'])(?P<uploader_id>.+?)\1', webpage,
'uploader id', fatal=False, group='uploader_id'),
2013-06-24 04:16:41 +08:00
}