mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-04 23:35:04 +00:00
[xvideos] Extract all thumbnails (closes #20432)
This commit is contained in:
parent
f412970164
commit
f4da808036
1 changed files with 12 additions and 5 deletions
|
@ -57,10 +57,17 @@ def _real_extract(self, url):
|
||||||
webpage, 'title', default=None,
|
webpage, 'title', default=None,
|
||||||
group='title') or self._og_search_title(webpage)
|
group='title') or self._og_search_title(webpage)
|
||||||
|
|
||||||
thumbnail = self._search_regex(
|
thumbnails = []
|
||||||
(r'setThumbUrl\(\s*(["\'])(?P<thumbnail>(?:(?!\1).)+)\1',
|
for preference, thumbnail in enumerate(('', '169')):
|
||||||
r'url_bigthumb=(?P<thumbnail>.+?)&'),
|
thumbnail_url = self._search_regex(
|
||||||
webpage, 'thumbnail', fatal=False, group='thumbnail')
|
r'setThumbUrl%s\(\s*(["\'])(?P<thumbnail>(?:(?!\1).)+)\1' % thumbnail,
|
||||||
|
webpage, 'thumbnail', default=None, group='thumbnail')
|
||||||
|
if thumbnail_url:
|
||||||
|
thumbnails.append({
|
||||||
|
'url': thumbnail_url,
|
||||||
|
'preference': preference,
|
||||||
|
})
|
||||||
|
|
||||||
duration = int_or_none(self._og_search_property(
|
duration = int_or_none(self._og_search_property(
|
||||||
'duration', webpage, default=None)) or parse_duration(
|
'duration', webpage, default=None)) or parse_duration(
|
||||||
self._search_regex(
|
self._search_regex(
|
||||||
|
@ -98,6 +105,6 @@ def _real_extract(self, url):
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'title': title,
|
'title': title,
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
'thumbnail': thumbnail,
|
'thumbnails': thumbnails,
|
||||||
'age_limit': 18,
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue