4 from .common
import InfoExtractor
14 class XVideosIE(InfoExtractor
):
18 (?:[^/]+\.)?xvideos2?\.com/video\.?|
19 (?:www\.)?xvideos\.es/video\.?|
20 (?:www|flashservice)\.xvideos\.com/embedframe/|
21 static-hw\.xvideos\.com/swf/xv-player\.swf\?.*?\bid_video=
26 'url': 'http://xvideos.com/video.ucuvbkfda4e/a_beautiful_red-haired_stranger_was_refused_but_still_came_to_my_room_for_sex',
27 'md5': '396255a900a6bddb3e98985f0b86c3fd',
31 'title': 'A Beautiful Red-Haired Stranger Was Refused, But Still Came To My Room For Sex',
34 'thumbnail': r
're:^https://cdn\d+-pic.xvideos-cdn.com/.+\.jpg',
38 'url': 'https://www.xvideos.com/video65982001/what_s_her_name',
39 'md5': '56742808292c8fa1418e4538c262c58b',
43 'title': 'what\'s her name?',
46 'thumbnail': r
're:^https://cdn\d+-pic.xvideos-cdn.com/.+\.jpg',
49 'url': 'https://flashservice.xvideos.com/embedframe/4588838',
50 'only_matching': True,
52 'url': 'https://www.xvideos.com/embedframe/4588838',
53 'only_matching': True,
55 'url': 'http://static-hw.xvideos.com/swf/xv-player.swf?id_video=4588838',
56 'only_matching': True,
58 'url': 'http://xvideos.com/video4588838/biker_takes_his_girl',
59 'only_matching': True,
61 'url': 'https://xvideos.com/video4588838/biker_takes_his_girl',
62 'only_matching': True,
64 'url': 'https://xvideos.es/video4588838/biker_takes_his_girl',
65 'only_matching': True,
67 'url': 'https://www.xvideos.es/video4588838/biker_takes_his_girl',
68 'only_matching': True,
70 'url': 'http://xvideos.es/video4588838/biker_takes_his_girl',
71 'only_matching': True,
73 'url': 'http://www.xvideos.es/video4588838/biker_takes_his_girl',
74 'only_matching': True,
76 'url': 'http://fr.xvideos.com/video4588838/biker_takes_his_girl',
77 'only_matching': True,
79 'url': 'https://fr.xvideos.com/video4588838/biker_takes_his_girl',
80 'only_matching': True,
82 'url': 'http://it.xvideos.com/video4588838/biker_takes_his_girl',
83 'only_matching': True,
85 'url': 'https://it.xvideos.com/video4588838/biker_takes_his_girl',
86 'only_matching': True,
88 'url': 'http://de.xvideos.com/video4588838/biker_takes_his_girl',
89 'only_matching': True,
91 'url': 'https://de.xvideos.com/video4588838/biker_takes_his_girl',
92 'only_matching': True,
94 'url': 'https://flashservice.xvideos.com/embedframe/ucuvbkfda4e',
95 'only_matching': True,
97 'url': 'https://www.xvideos.com/embedframe/ucuvbkfda4e',
98 'only_matching': True,
100 'url': 'http://static-hw.xvideos.com/swf/xv-player.swf?id_video=ucuvbkfda4e',
101 'only_matching': True,
103 'url': 'https://xvideos.es/video.ucuvbkfda4e/a_beautiful_red-haired_stranger_was_refused_but_still_came_to_my_room_for_sex',
104 'only_matching': True,
107 def _real_extract(self
, url
):
108 video_id
= self
._match
_id
(url
)
109 webpage
= self
._download
_webpage
(url
, video_id
)
111 mobj
= re
.search(r
'<h1 class="inlineError">(.+?)</h1>', webpage
)
113 raise ExtractorError(f
'{self.IE_NAME} said: {clean_html(mobj.group(1))}', expected
=True)
115 title
= self
._html
_search
_regex
(
116 (r
'<title>(?P<title>.+?)\s+-\s+XVID',
117 r
'setVideoTitle\s*\(\s*(["\'])(?P
<title
>(?
:(?
!\
1).)+)\
1'),
118 webpage, 'title
', default=None,
119 group='title
') or self._og_search_title(webpage)
122 for preference, thumbnail in enumerate(('', '169')):
123 thumbnail_url = self._search_regex(
124 rf'setThumbUrl{thumbnail}\
(\s
*(["\'])(?P<thumbnail>(?:(?!\1).)+)\1',
125 webpage, 'thumbnail', default=None, group='thumbnail')
128 'url': thumbnail_url,
129 'preference': preference,
132 duration = int_or_none(self._og_search_property(
133 'duration', webpage, default=None)) or parse_duration(
135 r'<span[^>]+class=["\']duration
["\'][^>]*>.*?(\d[^<]+)',
136 webpage, 'duration', fatal=False))
140 video_url = urllib.parse.unquote(self._search_regex(
141 r'flv_url=(.+?)&', webpage, 'video URL', default=''))
148 for kind, _, format_url in re.findall(
149 r'setVideo([^(]+)\((["\'])(http
.+?
)\
2\
)', webpage):
150 format_id = kind.lower()
151 if format_id == 'hls
':
152 hls_formats = self._extract_m3u8_formats(
153 format_url, video_id, 'mp4
',
154 entry_protocol='m3u8_native
', m3u8_id='hls
', fatal=False)
155 self._check_formats(hls_formats, video_id)
156 formats.extend(hls_formats)
157 elif format_id in ('urllow
', 'urlhigh
'):
160 'format_id
': '{}-{}'.format(determine_ext(format_url, 'mp4
'), format_id[3:]),
161 'quality
': -2 if format_id.endswith('low
') else None,
168 'duration
': duration,
169 'thumbnails
': thumbnails,
174 class XVideosQuickiesIE(InfoExtractor):
175 IE_NAME = 'xvideos
:quickies
'
176 _VALID_URL = r'https?
://(?P
<domain
>(?
:[^
/?
#]+\.)?xvideos2?\.com)/(?:profiles/|amateur-channels/)?[^/?#]+#quickies/a/(?P<id>\w+)'
178 'url': 'https://www.xvideos.com/lili_love#quickies/a/ipdtikh1a4c',
179 'md5': 'f9e4f518ff1de14b99a400bbd0fc5ee0',
183 'title': 'Mexican chichóna putisima',
186 'thumbnail': r
're:^https://cdn.*-pic.xvideos-cdn.com/.+\.jpg',
189 'url': 'https://www.xvideos.com/profiles/lili_love#quickies/a/ipphaob6fd1',
190 'md5': '5340938aac6b46e19ebdd1d84535862e',
194 'title': 'Puta chichona mexicana squirting',
197 'thumbnail': r
're:^https://cdn.*-pic.xvideos-cdn.com/.+\.jpg',
200 'url': 'https://www.xvideos.com/amateur-channels/lili_love#quickies/a/hfmffmd7661',
201 'md5': '92428518bbabcb4c513e55922e022491',
205 'title': 'Chichona mexican slut',
208 'thumbnail': r
're:^https://cdn.*-pic.xvideos-cdn.com/.+\.jpg',
211 'url': 'https://www.xvideos.com/amateur-channels/wifeluna#quickies/a/47258683',
212 'md5': '16e322a93282667f1963915568f782c1',
216 'title': 'Verification video',
219 'thumbnail': r
're:^https://cdn.*-pic.xvideos-cdn.com/.+\.jpg',
223 def _real_extract(self
, url
):
224 domain
, id_
= self
._match
_valid
_url
(url
).group('domain', 'id')
225 return self
.url_result(f
'https://{domain}/video{"" if id_.isdecimal() else "."}{id_}/_', XVideosIE
, id_
)