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.

39 lines
1.3 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class KeekIE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:www\.)?keek\.com/keek/(?P<id>\w+)'
  6. IE_NAME = 'keek'
  7. _TEST = {
  8. 'url': 'https://www.keek.com/keek/NODfbab',
  9. 'md5': '9b0636f8c0f7614afa4ea5e4c6e57e83',
  10. 'info_dict': {
  11. 'id': 'NODfbab',
  12. 'ext': 'mp4',
  13. 'title': 'md5:35d42050a3ece241d5ddd7fdcc6fd896',
  14. 'uploader': 'ytdl',
  15. 'uploader_id': 'eGT5bab',
  16. },
  17. }
  18. def _real_extract(self, url):
  19. video_id = self._match_id(url)
  20. webpage = self._download_webpage(url, video_id)
  21. return {
  22. 'id': video_id,
  23. 'url': self._og_search_video_url(webpage),
  24. 'ext': 'mp4',
  25. 'title': self._og_search_description(webpage).strip(),
  26. 'thumbnail': self._og_search_thumbnail(webpage),
  27. 'uploader': self._search_regex(
  28. r'data-username=(["\'])(?P<uploader>.+?)\1', webpage,
  29. 'uploader', fatal=False, group='uploader'),
  30. 'uploader_id': self._search_regex(
  31. r'data-user-id=(["\'])(?P<uploader_id>.+?)\1', webpage,
  32. 'uploader id', fatal=False, group='uploader_id'),
  33. }