mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-25 03:32:05 +00:00
[redditr] Extract all thumbnails
This commit is contained in:
parent
7b0f04ed1f
commit
d1d0612160
1 changed files with 14 additions and 1 deletions
|
@ -9,6 +9,7 @@ from ..utils import (
|
||||||
float_or_none,
|
float_or_none,
|
||||||
try_get,
|
try_get,
|
||||||
url_or_none,
|
url_or_none,
|
||||||
|
unescapeHTML,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,11 +119,23 @@ class RedditRIE(InfoExtractor):
|
||||||
else:
|
else:
|
||||||
age_limit = None
|
age_limit = None
|
||||||
|
|
||||||
|
thumbnails = []
|
||||||
|
images = try_get(
|
||||||
|
data, lambda x: x['preview']['images'][0]['resolutions']) or []
|
||||||
|
for image in images:
|
||||||
|
url = url_or_none(unescapeHTML(image['url']))
|
||||||
|
if url is not None:
|
||||||
|
thumbnails.append({
|
||||||
|
'url': url,
|
||||||
|
'width': int_or_none(image['width']),
|
||||||
|
'height': int_or_none(image['height']),
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'_type': 'url_transparent',
|
'_type': 'url_transparent',
|
||||||
'url': video_url,
|
'url': video_url,
|
||||||
'title': data.get('title'),
|
'title': data.get('title'),
|
||||||
'thumbnail': url_or_none(data.get('thumbnail')),
|
'thumbnails': thumbnails,
|
||||||
'timestamp': float_or_none(data.get('created_utc')),
|
'timestamp': float_or_none(data.get('created_utc')),
|
||||||
'uploader': data.get('author'),
|
'uploader': data.get('author'),
|
||||||
'duration': int_or_none(try_get(
|
'duration': int_or_none(try_get(
|
||||||
|
|
Loading…
Reference in a new issue