peekvids.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. from .common import InfoExtractor
  2. class PeekVidsIE(InfoExtractor):
  3. _VALID_URL = r'''(?x)
  4. https?://(?:www\.)?peekvids\.com/
  5. (?:(?:[^/?#]+/){2}|embed/?\?(?:[^#]*&)?v=)
  6. (?P<id>[^/?&#]*)
  7. '''
  8. _TESTS = [{
  9. 'url': 'https://peekvids.com/pc/dane-jones-cute-redhead-with-perfect-tits-with-mini-vamp/BSyLMbN0YCd',
  10. 'md5': 'a00940646c428e232407e3e62f0e8ef5',
  11. 'info_dict': {
  12. 'id': 'BSyLMbN0YCd',
  13. 'title': ' Dane Jones - Cute redhead with perfect tits with Mini Vamp, SEXYhub',
  14. 'ext': 'mp4',
  15. 'thumbnail': r're:^https?://.*\.jpg$',
  16. 'description': 'Watch Dane Jones - Cute redhead with perfect tits with Mini Vamp (7 min), uploaded by SEXYhub.com',
  17. 'timestamp': 1642579329,
  18. 'upload_date': '20220119',
  19. 'duration': 416,
  20. 'view_count': int,
  21. 'age_limit': 18,
  22. },
  23. }]
  24. _DOMAIN = 'www.peekvids.com'
  25. def _real_extract(self, url):
  26. video_id = self._match_id(url)
  27. webpage = self._download_webpage(url, video_id)
  28. short_video_id = self._html_search_regex(r'<video [^>]*data-id="(.+?)"', webpage, 'short video ID')
  29. srcs = self._download_json(
  30. f'https://{self._DOMAIN}/v-alt/{short_video_id}', video_id,
  31. note='Downloading list of source files')
  32. formats = [{
  33. 'url': url,
  34. 'ext': 'mp4',
  35. 'format_id': name[8:],
  36. } for name, url in srcs.items() if len(name) > 8 and name.startswith('data-src')]
  37. if not formats:
  38. formats = [{'url': url} for url in srcs.values()]
  39. info = self._search_json_ld(webpage, video_id, expected_type='VideoObject')
  40. info.update({
  41. 'id': video_id,
  42. 'age_limit': 18,
  43. 'formats': formats,
  44. })
  45. return info
  46. class PlayVidsIE(PeekVidsIE): # XXX: Do not subclass from concrete IE
  47. _VALID_URL = r'https?://(?:www\.)?playvids\.com/(?:embed/|[^/]{2}/)?(?P<id>[^/?#]*)'
  48. _TESTS = [{
  49. 'url': 'https://www.playvids.com/U3pBrYhsjXM/pc/dane-jones-cute-redhead-with-perfect-tits-with-mini-vamp',
  50. 'md5': 'cd7dfd8a2e815a45402369c76e3c1825',
  51. 'info_dict': {
  52. 'id': 'U3pBrYhsjXM',
  53. 'title': ' Dane Jones - Cute redhead with perfect tits with Mini Vamp, SEXYhub',
  54. 'ext': 'mp4',
  55. 'thumbnail': r're:^https?://.*\.jpg$',
  56. 'description': 'Watch Dane Jones - Cute redhead with perfect tits with Mini Vamp video in HD, uploaded by SEXYhub.com',
  57. 'timestamp': 1640435839,
  58. 'upload_date': '20211225',
  59. 'duration': 416,
  60. 'view_count': int,
  61. 'age_limit': 18,
  62. },
  63. }, {
  64. 'url': 'https://www.playvids.com/es/U3pBrYhsjXM/pc/dane-jones-cute-redhead-with-perfect-tits-with-mini-vamp',
  65. 'only_matching': True,
  66. }, {
  67. 'url': 'https://www.playvids.com/embed/U3pBrYhsjXM',
  68. 'only_matching': True,
  69. }]
  70. _DOMAIN = 'www.playvids.com'