1 from .common
import InfoExtractor
15 class EpornerIE(InfoExtractor
):
16 _VALID_URL
= r
'https?://(?:www\.)?eporner\.com/(?:(?:hd-porn|embed)/|video-)(?P<id>\w+)(?:/(?P<display_id>[\w-]+))?'
18 'url': 'http://www.eporner.com/hd-porn/95008/Infamous-Tiffany-Teen-Strip-Tease-Video/',
19 'md5': '39d486f046212d8e1b911c52ab4691f8',
22 'display_id': 'Infamous-Tiffany-Teen-Strip-Tease-Video',
24 'title': 'Infamous Tiffany Teen Strip Tease Video',
25 'description': 'md5:764f39abf932daafa37485eb46efa152',
26 'timestamp': 1232520922,
27 'upload_date': '20090121',
33 # New (May 2016) URL layout
34 'url': 'http://www.eporner.com/hd-porn/3YRUtzMcWn0/Star-Wars-XXX-Parody/',
35 'only_matching': True,
37 'url': 'http://www.eporner.com/hd-porn/3YRUtzMcWn0',
38 'only_matching': True,
40 'url': 'http://www.eporner.com/embed/3YRUtzMcWn0',
41 'only_matching': True,
43 'url': 'https://www.eporner.com/video-FJsA19J3Y3H/one-of-the-greats/',
44 'only_matching': True,
47 def _real_extract(self
, url
):
48 mobj
= self
._match
_valid
_url
(url
)
49 video_id
= mobj
.group('id')
50 display_id
= mobj
.group('display_id') or video_id
52 webpage
, urlh
= self
._download
_webpage
_handle
(url
, display_id
)
54 video_id
= self
._match
_id
(urlh
.url
)
56 vid_hash
= self
._search
_regex
(
57 r
'hash\s*[:=]\s*["\']([\da
-f
]{32}
)', webpage, 'hash')
59 title = self._og_search_title(webpage, default=None) or self._html_search_regex(
60 r'<title
>(.+?
) - EPORNER
', webpage, 'title
')
62 # Reverse engineered from vjs.js
64 return ''.join(encode_base_n(int(s[lb:lb + 8], 16), 36) for lb in range(0, 32, 8))
66 video = self._download_json(
67 f'http
://www
.eporner
.com
/xhr
/video
/{video_id}
',
68 display_id, note='Downloading video JSON
',
70 'hash': calc_hash(vid_hash),
72 'domain
': 'www
.eporner
.com
',
76 if video.get('available
') is False:
78 '{} said
: {}'.format(self.IE_NAME, video['message
']), expected=True)
80 sources = video['sources
']
83 has_av1 = bool(get_elements_by_class('download
-av1
', webpage))
84 for kind, formats_dict in sources.items():
85 if not isinstance(formats_dict, dict):
87 for format_id, format_dict in formats_dict.items():
88 if not isinstance(format_dict, dict):
90 src = url_or_none(format_dict.get('src
'))
91 if not src or not src.startswith('http
'):
94 formats.extend(self._extract_m3u8_formats(
95 src, display_id, 'mp4
', entry_protocol='m3u8_native
',
96 m3u8_id=kind, fatal=False))
98 height = int_or_none(self._search_regex(
99 r'(\d
+)[pP
]', format_id, 'height
', default=None))
100 fps = int_or_none(self._search_regex(
101 r'(\d
+)fps
', format_id, 'fps
', default=None))
105 'format_id
': format_id,
111 'url
': src.replace('.mp4
', '-av1
.mp4
'),
112 'format_id
': join_nonempty('av1
', format_id),
118 json_ld = self._search_json_ld(webpage, display_id, default={})
120 duration = parse_duration(self._html_search_meta(
121 'duration
', webpage, default=None))
122 view_count = str_to_int(self._search_regex(
123 r'id=["\']cinemaviews1["\'][^
>]*>\s
*([0-9,]+)',
124 webpage, 'view count
', default=None))
126 return merge_dicts(json_ld, {
128 'display_id
': display_id,
130 'duration
': duration,
131 'view_count
': view_count,