A feature-rich command-line audio/video downloader
[ie/youtube:tab] Fix flat thumbnails extraction for shorts (#15331)
bashonlyff61bef041d1
diff --git a/test/helper.py b/test/helper.pyindex e96835fc46..5a937d9617 100644--- a/test/helper.py+++ b/test/helper.py@@ -261,7 +261,7 @@ def sanitize_got_info_dict(got_dict):def expect_info_dict(self, got_dict, expected_dict):ALLOWED_KEYS_SORT_ORDER = (# NB: Keep in sync with the docstring of extractor/common.py- 'id', 'ext', 'direct', 'display_id', 'title', 'alt_title', 'description', 'media_type',+ 'ie_key', 'url', 'id', 'ext', 'direct', 'display_id', 'title', 'alt_title', 'description', 'media_type','uploader', 'uploader_id', 'uploader_url', 'channel', 'channel_id', 'channel_url', 'channel_is_verified','channel_follower_count', 'comment_count', 'view_count', 'concurrent_view_count','like_count', 'dislike_count', 'repost_count', 'average_rating', 'age_limit', 'duration', 'thumbnail', 'heatmap',diff --git a/yt_dlp/extractor/youtube/_tab.py b/yt_dlp/extractor/youtube/_tab.pyindex f991d99759..450b4aa51d 100644--- a/yt_dlp/extractor/youtube/_tab.py+++ b/yt_dlp/extractor/youtube/_tab.py@@ -382,7 +382,8 @@ class YoutubeTabBaseInfoExtractor(YoutubeBaseInfoExtractor):('accessibilityText', {lambda x: re.fullmatch(r'(.+), (?:[\d,.]+(?:[KM]| million)?|No) views? - play Short', x)}, 1)), any),'view_count': ('overlayMetadata', 'secondaryText', 'content', {parse_count}),}),- thumbnails=self._extract_thumbnails(renderer, 'thumbnail', final_key='sources'))+ thumbnails=self._extract_thumbnails(+ renderer, ('thumbnailViewModel', 'thumbnailViewModel', 'image'), final_key='sources'))returndef _video_entry(self, video_renderer):@@ -1585,7 +1586,6 @@ class YoutubeTabIE(YoutubeTabBaseInfoExtractor):'playlist_count': 50,'expected_warnings': ['YouTube Music is not directly supported'],}, {- # TODO: fix test suite, 208163447408c78673b08c172beafe5c310fb167 broke this test'note': 'unlisted single video playlist','url': 'https://www.youtube.com/playlist?list=PLt5yu3-wZAlQLfIN0MMgp0wVV6MP3bM4_','info_dict': {@@ -1885,8 +1885,6 @@ class YoutubeTabIE(YoutubeTabBaseInfoExtractor):'playlist_mincount': 30,}, {# Shorts url result in shorts tab- # TODO: Fix channel id extraction- # TODO: fix test suite, 208163447408c78673b08c172beafe5c310fb167 broke this test'url': 'https://www.youtube.com/channel/UCiu-3thuViMebBjw_5nWYrA/shorts','info_dict': {'id': 'UCiu-3thuViMebBjw_5nWYrA',@@ -1915,7 +1913,6 @@ class YoutubeTabIE(YoutubeTabBaseInfoExtractor):'params': {'extract_flat': True},}, {# Live video status should be extracted- # TODO: fix test suite, 208163447408c78673b08c172beafe5c310fb167 broke this test'url': 'https://www.youtube.com/channel/UCQvWX73GQygcwXOTSf_VDVg/live','info_dict': {'id': 'UCQvWX73GQygcwXOTSf_VDVg',