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

Code before:
                        'sd video url', default=None, group='url')
                    if sd_url:
                        sources.append((sd_url, 'sd'))
                    sources.append((hd_url, 'hd'))

                    formats = [{
                        'url': video_url,
                        'format_id': format_id,
                        'height': int_or_none(self._search_regex(
                            r'_(\d+)\.\w+$', video_url, 'height', default=None)),
                        'quality': quality,
                    } for quality, (video_url, format_id) in enumerate(sources)]

        if not formats and fallback_format:
            formats.append(fallback_format)

        if formats:
            # tumblr's own video is always above embeds
            entries = [{
                **info_dict,
                'formats': formats,
                'duration': duration,
                'thumbnail': traverse_obj(
                    video_json, ('poster', 0, 'url')) or self._og_search_thumbnail(
                        webpage, default=None)},
                *entries]

        if ignored_providers:
            if not entries:
                raise ExtractorError(f'None of embed providers are supported: {", ".join(ignored_providers)!s}', video_id=video_id, expected=True)
            else:
                self.report_warning(f'Skipped embeds from unsupported providers: {", ".join(ignored_providers)!s}', video_id)
        if unknown_providers:
            self.report_warning(f'Unrecognized providers, please report: {", ".join(unknown_providers)!s}', video_id)

        if not entries:
            self.raise_no_formats('No video could be found in this post', expected=True, video_id=video_id)
        if len(entries) == 1:
            return {
                **info_dict,
                **entries[0],
            }
        return {
            **info_dict,
            '_type': 'playlist',
            'entries': entries,
        }


Review comment (suggestion):
```suggestion
            entries.insert(0, {
                **info_dict,
                'formats': formats,
                'duration': duration,
                'thumbnail': (traverse_obj(video_json, ('poster', 0, 'url', {url_or_none}))
                              or self._og_search_thumbnail(webpage, default=None)),
            })
```

Code after:
                        r'<source[^>]+src=(["\'])(?P<url>.+?)\1', iframe,
                        'sd video url', default=None, group='url')
                    if sd_url:
                        sources.append((sd_url, 'sd'))
                    sources.append((hd_url, 'hd'))

                    formats = [{
                        'url': video_url,
                        'format_id': format_id,
                        'height': int_or_none(self._search_regex(
                            r'_(\d+)\.\w+$', video_url, 'height', default=None)),
                        'quality': quality,
                    } for quality, (video_url, format_id) in enumerate(sources)]

        if not formats and fallback_format:
            formats.append(fallback_format)

        if formats:
            # tumblr's own video is always above embeds
            entries.insert(0, {
                **info_dict,
                'formats': formats,
                'duration': duration,
                'thumbnail': (traverse_obj(video_json, ('poster', 0, 'url', {url_or_none}))
                              or self._og_search_thumbnail(webpage, default=None)),
            })

        if ignored_providers:
            if not entries:
                raise ExtractorError(f'None of embed providers are supported: {", ".join(ignored_providers)!s}', video_id=video_id, expected=True)
            else:
                self.report_warning(f'Skipped embeds from unsupported providers: {", ".join(ignored_providers)!s}', video_id)
        if unknown_providers:
            self.report_warning(f'Unrecognized providers, please report: {", ".join(unknown_providers)!s}', video_id)

        if not entries:
            self.raise_no_formats('No video could be found in this post', expected=True, video_id=video_id)
        if len(entries) == 1:
            return {
                **info_dict,
                **entries[0],
            }
        return {
            **info_dict,
            '_type': 'playlist',
            'entries': entries,
        }