mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 06:10:12 +01:00
[ie/threads] Fix multi mixed media extraction
This commit is contained in:
parent
c9da74e5e7
commit
e0eefb2c5a
|
@ -75,7 +75,7 @@ def _real_extract(self, url):
|
|||
thumbnails = []
|
||||
|
||||
# Videos
|
||||
if (post.get('carousel_media') is not None): # Handle multiple videos posts
|
||||
if post.get('carousel_media') is not None: # Handle multiple videos posts
|
||||
media_list = post.get('carousel_media')
|
||||
else:
|
||||
media_list = [post]
|
||||
|
@ -83,13 +83,14 @@ def _real_extract(self, url):
|
|||
for media in media_list:
|
||||
videos = media.get('video_versions')
|
||||
|
||||
for video in videos:
|
||||
formats.append({
|
||||
'format_id': '%s-%s' % (media.get('pk'), video['type']), # id-type
|
||||
'url': video['url'],
|
||||
'width': media.get('original_width'),
|
||||
'height': media.get('original_height'),
|
||||
})
|
||||
if videos:
|
||||
for video in videos:
|
||||
formats.append({
|
||||
'format_id': '%s-%s' % (media.get('pk'), video['type']), # id-type
|
||||
'url': video['url'],
|
||||
'width': media.get('original_width'),
|
||||
'height': media.get('original_height'),
|
||||
})
|
||||
|
||||
# Thumbnails
|
||||
thumbs = traverse_obj(post, ('image_versions2', 'candidates'))
|
||||
|
|
Loading…
Reference in New Issue
Block a user