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.

40 lines
1.3 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. _TEST = {
  7. u'url': u'http://www.keek.com/ytdl/keeks/NODfbab',
  8. u'file': u'NODfbab.mp4',
  9. u'md5': u'9b0636f8c0f7614afa4ea5e4c6e57e83',
  10. u'info_dict': {
  11. u"uploader": u"ytdl",
  12. u"title": u"test chars: \"'/\\\u00e4<>This is a test video for youtube-dl.For more information, contact phihag@phihag.de ."
  13. }
  14. }
  15. def _real_extract(self, url):
  16. m = re.match(self._VALID_URL, url)
  17. video_id = m.group('videoID')
  18. video_url = u'http://cdn.keek.com/keek/video/%s' % video_id
  19. thumbnail = u'http://cdn.keek.com/keek/thumbnail/%s/w100/h75' % video_id
  20. webpage = self._download_webpage(url, video_id)
  21. video_title = self._og_search_title(webpage)
  22. uploader = self._html_search_regex(r'<div class="user-name-and-bio">[\S\s]+?<h2>(?P<uploader>.+?)</h2>',
  23. webpage, u'uploader', fatal=False)
  24. info = {
  25. 'id': video_id,
  26. 'url': video_url,
  27. 'ext': 'mp4',
  28. 'title': video_title,
  29. 'thumbnail': thumbnail,
  30. 'uploader': uploader
  31. }
  32. return [info]