videofyme.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. from .common import InfoExtractor
  2. from ..utils import (
  3. int_or_none,
  4. parse_iso8601,
  5. )
  6. class VideofyMeIE(InfoExtractor):
  7. _WORKING = False
  8. _VALID_URL = r'https?://(?:www\.videofy\.me/.+?|p\.videofy\.me/v)/(?P<id>\d+)(&|#|$)'
  9. IE_NAME = 'videofy.me'
  10. _TEST = {
  11. 'url': 'http://www.videofy.me/thisisvideofyme/1100701',
  12. 'md5': 'c77d700bdc16ae2e9f3c26019bd96143',
  13. 'info_dict': {
  14. 'id': '1100701',
  15. 'ext': 'mp4',
  16. 'title': 'This is VideofyMe',
  17. 'description': '',
  18. 'upload_date': '20130326',
  19. 'timestamp': 1364288959,
  20. 'uploader': 'VideofyMe',
  21. 'uploader_id': 'thisisvideofyme',
  22. 'view_count': int,
  23. 'like_count': int,
  24. 'comment_count': int,
  25. },
  26. }
  27. def _real_extract(self, url):
  28. video_id = self._match_id(url)
  29. config = self._download_json(f'http://vf-player-info-loader.herokuapp.com/{video_id}.json', video_id)['videoinfo']
  30. video = config.get('video')
  31. blog = config.get('blog', {})
  32. return {
  33. 'id': video_id,
  34. 'title': video['title'],
  35. 'url': video['sources']['source']['url'],
  36. 'thumbnail': video.get('thumb'),
  37. 'description': video.get('description'),
  38. 'timestamp': parse_iso8601(video.get('date')),
  39. 'uploader': blog.get('name'),
  40. 'uploader_id': blog.get('identifier'),
  41. 'view_count': int_or_none(self._search_regex(r'([0-9]+)', video.get('views'), 'view count', fatal=False)),
  42. 'like_count': int_or_none(video.get('likes')),
  43. 'comment_count': int_or_none(video.get('nrOfComments')),
  44. }