]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/eporner.py
1 from .common
import InfoExtractor
13 class EpornerIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://(?:www\.)?eporner\.com/(?:(?:hd-porn|embed)/|video-)(?P<id>\w+)(?:/(?P<display_id>[\w-]+))?'
16 'url': 'http://www.eporner.com/hd-porn/95008/Infamous-Tiffany-Teen-Strip-Tease-Video/',
17 'md5': '39d486f046212d8e1b911c52ab4691f8',
20 'display_id': 'Infamous-Tiffany-Teen-Strip-Tease-Video',
22 'title': 'Infamous Tiffany Teen Strip Tease Video',
23 'description': 'md5:764f39abf932daafa37485eb46efa152',
24 'timestamp': 1232520922,
25 'upload_date': '20090121',
31 'proxy': '127.0.0.1:8118'
34 # New (May 2016) URL layout
35 'url': 'http://www.eporner.com/hd-porn/3YRUtzMcWn0/Star-Wars-XXX-Parody/',
36 'only_matching': True,
38 'url': 'http://www.eporner.com/hd-porn/3YRUtzMcWn0',
39 'only_matching': True,
41 'url': 'http://www.eporner.com/embed/3YRUtzMcWn0',
42 'only_matching': True,
44 'url': 'https://www.eporner.com/video-FJsA19J3Y3H/one-of-the-greats/',
45 'only_matching': True,
48 def _real_extract(self
, url
):
49 mobj
= self
._match
_valid
_url
(url
)
50 video_id
= mobj
.group('id')
51 display_id
= mobj
.group('display_id') or video_id
53 webpage
, urlh
= self
._download
_webpage
_handle
(url
, display_id
)
55 video_id
= self
._match
_id
(urlh
.url
)
57 hash = self
._search
_regex
(
58 r
'hash\s*[:=]\s*["\']([\da
-f
]{32}
)', webpage, 'hash')
60 title = self._og_search_title(webpage, default=None) or self._html_search_regex(
61 r'<title
>(.+?
) - EPORNER
', webpage, 'title
')
63 # Reverse engineered from vjs.js
65 return ''.join((encode_base_n(int(s[lb:lb + 8], 16), 36) for lb in range(0, 32, 8)))
67 video = self._download_json(
68 'http
://www
.eporner
.com
/xhr
/video
/%s' % video_id,
69 display_id, note='Downloading video JSON
',
71 'hash': calc_hash(hash),
73 'domain
': 'www
.eporner
.com
',
77 if video.get('available
') is False:
79 '%s said
: %s' % (self.IE_NAME, video['message
']), expected=True)
81 sources = video['sources
']
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,
110 json_ld = self._search_json_ld(webpage, display_id, default={})
112 duration = parse_duration(self._html_search_meta(
113 'duration
', webpage, default=None))
114 view_count = str_to_int(self._search_regex(
115 r'id=["\']cinemaviews1["\'][^
>]*>\s
*([0-9,]+)',
116 webpage, 'view count
', default=None))
118 return merge_dicts(json_ld, {
120 'display_id
': display_id,
122 'duration
': duration,
123 'view_count
': view_count,