You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.0 KiB

  1. import re
  2. from .common import InfoExtractor
  3. class KeekIE(InfoExtractor):
  4. _VALID_URL = r'http://(?:www\.)?keek\.com/(?:!|\w+/keeks/)(?P<videoID>\w+)'
  5. IE_NAME = u'keek'
  6. def _real_extract(self, url):
  7. m = re.match(self._VALID_URL, url)
  8. video_id = m.group('videoID')
  9. video_url = u'http://cdn.keek.com/keek/video/%s' % video_id
  10. thumbnail = u'http://cdn.keek.com/keek/thumbnail/%s/w100/h75' % video_id
  11. webpage = self._download_webpage(url, video_id)
  12. video_title = self._html_search_regex(r'<meta property="og:title" content="(?P<title>.*?)"',
  13. webpage, u'title')
  14. uploader = self._html_search_regex(r'<div class="user-name-and-bio">[\S\s]+?<h2>(?P<uploader>.+?)</h2>',
  15. webpage, u'uploader', fatal=False)
  16. info = {
  17. 'id': video_id,
  18. 'url': video_url,
  19. 'ext': 'mp4',
  20. 'title': video_title,
  21. 'thumbnail': thumbnail,
  22. 'uploader': uploader
  23. }
  24. return [info]