Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/nosnl.py (Python)

Code before:
        }
    ]

    def _get_video_thumbnails(self, image_data):
        thumb_data = []
        for image in image_data.get('16:9') or []:
            thumb_data.append({
                'url': traverse_obj(image, ('url', ...), get_all=False),
                'width': image.get('width'),
                'height': image.get('height')
            })
        return thumb_data

    def _get_video_generator(self, nextjs_json, display_id):
        for item in nextjs_json['items']:
            if item.get('type') == 'video':
                formats, subtitle = self._extract_m3u8_formats_and_subtitles(
                    traverse_obj(item, ('source', 'url')), display_id, ext='mp4')
                yield {
                    'id': str(item['id']),
                    'title': item.get('title'),
                    'description': item.get('description'),
                    'formats': formats,
                    'subtitles': subtitle,
                    'duration': parse_duration(item.get('duration')),
                    'thumbnails': self._get_video_thumbnails(item.get('imagesByRatio'))
                }

            elif item.get('type') == 'audio':
                yield {
                    'id': str(item['id']),
                    'title': item.get('title'),
                    'url': traverse_obj(item, ('media', 'src')),
                    'ext': 'mp3',
                }

    def _real_extract(self, url):
        display_id = self._match_valid_url(url).group('display_id')
        webpage = self._download_webpage(url, display_id)

        nextjs_json = self._search_nextjs_data(webpage, display_id)['props']['pageProps']['data']
        return {
            '_type': 'playlist',
            'entries': self._get_video_generator(nextjs_json, display_id),
            'id': str(nextjs_json['id']),
            'title': nextjs_json.get('title') or self._html_search_meta(['title', 'og:title', 'twitter:title'], webpage),
            'description': (nextjs_json.get('description')
                            or self._html_search_meta(['description', 'twitter:description', 'og:description'], webpage)),
            'tags': nextjs_json.get('keywords'),
            'modified_timestamp': parse_iso8601(nextjs_json.get('modifiedAt')),
            'thumbnail': nextjs_json.get('shareImageSrc') or self._html_search_meta(['og:image', 'twitter:image'], webpage),

Review comment (suggestion):
```suggestion
                    'thumbnails': [{
                        'url': traverse_obj(image, ('url', ...), get_all=False),
                        'width': image.get('width'),
                        'height': image.get('height')
                    } for image in traverse_obj(item, ('imagesByRatio', ...))],
```

Code after:
        }
    ]

    def _entries(self, nextjs_json, display_id):
        for item in nextjs_json['items']:
            if item.get('type') == 'video':
                formats, subtitle = self._extract_m3u8_formats_and_subtitles(
                    traverse_obj(item, ('source', 'url')), display_id, ext='mp4')
                yield {
                    'id': str(item['id']),
                    'title': item.get('title'),
                    'description': item.get('description'),
                    'formats': formats,
                    'subtitles': subtitle,
                    'duration': parse_duration(item.get('duration')),
                    'thumbnails': [{
                        'url': traverse_obj(image, ('url', ...), get_all=False),
                        'width': image.get('width'),
                        'height': image.get('height')
                    } for image in traverse_obj(item, ('imagesByRatio', ...))[0]],
                }

            elif item.get('type') == 'audio':
                yield {
                    'id': str(item['id']),
                    'title': item.get('title'),
                    'url': traverse_obj(item, ('media', 'src')),
                    'ext': 'mp3',
                }

    def _real_extract(self, url):
        display_id = self._match_valid_url(url).group('display_id')
        webpage = self._download_webpage(url, display_id)

        nextjs_json = self._search_nextjs_data(webpage, display_id)['props']['pageProps']['data']
        return {
            '_type': 'playlist',
            'entries': self._entries(nextjs_json, display_id),
            'id': str(nextjs_json['id']),
            'title': nextjs_json.get('title') or self._html_search_meta(['title', 'og:title', 'twitter:title'], webpage),
            'description': (nextjs_json.get('description')
                            or self._html_search_meta(['description', 'twitter:description', 'og:description'], webpage)),
            'tags': nextjs_json.get('keywords'),
            'modified_timestamp': parse_iso8601(nextjs_json.get('modifiedAt')),
            'thumbnail': nextjs_json.get('shareImageSrc') or self._html_search_meta(['og:image', 'twitter:image'], webpage),
            'timestamp': parse_iso8601(nextjs_json.get('publishedAt'))
        }