mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-01-19 07:13:05 +01:00
[ie/threads] Fix multi mixed media extraction
This commit is contained in:
parent
c9da74e5e7
commit
e0eefb2c5a
1 changed files with 9 additions and 8 deletions
|
@ -75,7 +75,7 @@ class ThreadsIE(InfoExtractor):
|
||||||
thumbnails = []
|
thumbnails = []
|
||||||
|
|
||||||
# Videos
|
# 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')
|
media_list = post.get('carousel_media')
|
||||||
else:
|
else:
|
||||||
media_list = [post]
|
media_list = [post]
|
||||||
|
@ -83,13 +83,14 @@ class ThreadsIE(InfoExtractor):
|
||||||
for media in media_list:
|
for media in media_list:
|
||||||
videos = media.get('video_versions')
|
videos = media.get('video_versions')
|
||||||
|
|
||||||
for video in videos:
|
if videos:
|
||||||
formats.append({
|
for video in videos:
|
||||||
'format_id': '%s-%s' % (media.get('pk'), video['type']), # id-type
|
formats.append({
|
||||||
'url': video['url'],
|
'format_id': '%s-%s' % (media.get('pk'), video['type']), # id-type
|
||||||
'width': media.get('original_width'),
|
'url': video['url'],
|
||||||
'height': media.get('original_height'),
|
'width': media.get('original_width'),
|
||||||
})
|
'height': media.get('original_height'),
|
||||||
|
})
|
||||||
|
|
||||||
# Thumbnails
|
# Thumbnails
|
||||||
thumbs = traverse_obj(post, ('image_versions2', 'candidates'))
|
thumbs = traverse_obj(post, ('image_versions2', 'candidates'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue