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