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

Code before:
        'info_dict': {
            'id': '',
            'ext': 'mp4',
            'title': 'My “Friends” Joined the Russians - CivDiv',
            'thumbnail': r're:^https?://.*\.jpg$',
            'uploader': '',
            'width': '',
            'height': '',
            'fps': '',
            'duration': '',
            'upload_date': '',
            'description': 'md5:',
        }
    }]

    def _real_extract(self, url):
        display_id = self._match_id(url)
        webpage = self._download_webpage(url, display_id)
        rumble = RumbleEmbedIE(downloader=self._downloader)
        youtube = YoutubeIE(downloader=self._downloader)
        found_rumble_videos = rumble._extract_embed_urls(url, webpage)
        found_yt_videos = list(youtube._extract_embed_urls(url, webpage))  # TODO: is converting it to a list OK if there's only one video?
        if len(list(found_yt_videos)):
            embedded_video = youtube.extract(found_yt_videos[0])  # TODO: do I need to do all found videos or is [0] ok?
        elif len(found_rumble_videos):
            embedded_video = rumble.extract(found_rumble_videos[0])  # TODO: see above
            desc_regex = re.compile(r'(?s)<div class="row video-desc-paragraph">.*?<p>(.*?)(About the Author|<\/div>\n?<\/div>\n?<\/div>)')
            # _html_search_regex is not cleaning <style> tags so we'll do it ourselves.
            # description = self._html_search_regex(desc_regex, webpage, 'description', fatal=False)
            description = re.search(desc_regex, webpage).group(1)
            if description:
                description = clean_html(re.sub(r'<style>(.|\s)*?<\/style>', '', description))

            embedded_video['description'] = description
        else:
            # TODO: is this correct if nothing is found?
            return
        return embedded_video


Review comment (bug):
You were on the right track here. But since this site only offers embeds, IMO it makes more sense to return url results to their respective extractors. `_extract_embed_urls` is a classmethod so we can call it from the class.

If no videos are found on the page, you could do one of the following:
  1. `raise ExtractorError`: e.g. if something is wrong and we want a bug report about it
  2. `self.raise_no_formats`: e.g. other extraction steps are working but no formats can be found
  3. or, if metadata has been extracted and there isn't anything else fatal before the return, you can let the extractor return a format-less info_dict and core code will `raise_no_formats`. Don't return `None`, though
```suggestion
        info = {}
        rumble_urls = RumbleEmbedIE._extract_embed_urls(url, webpage)
        if rumble_urls:
            info.update({'url': rumble_urls[0], 'ie_key': RumbleEmbedIE.ie_key()})
        else:
            youtube_url = next(YoutubeIE._extract_embed_urls(url, webpage), None)
            if youtube_url:
                info.update({'url': youtube_url, 'ie_key': YoutubeIE.ie_key()})
        if not info:
            raise ExtractorError('No videos found on webpage')
```

Code after:
            'channel_follower_count': int,
            'thumbnail': 'https://i.ytimg.com/vi/k-pk4bOvoac/maxresdefault.jpg',
            'uploader_id': '@CivDiv',
            'duration': 357,
            'channel_url': 'https://www.youtube.com/channel/UCgsCiwJ88up-YyMHo7hL5-A',
            'tags': [],
            'uploader_url': 'https://www.youtube.com/@CivDiv',
            'channel_id': 'UCgsCiwJ88up-YyMHo7hL5-A',
            'like_count': int,
            'description': 'md5:aef75ec3f59c07a0e39400f609b24429',
            'live_status': 'not_live',
            'age_limit': 0,
            'uploader': 'Civ Div',
            'categories': ['People & Blogs'],
            'title': 'My “Friends” joined the Russians.',
            'availability': 'public',
            'upload_date': '20230608',
            'playable_in_embed': True,
            'heatmap': 'count:100',
        }
    }]

    def _real_extract(self, url):
        display_id = self._match_id(url)
        webpage = self._download_webpage(url, display_id)
        rumble_url = list(RumbleEmbedIE._extract_embed_urls(url, webpage))
        if rumble_url:
            info = {'url': rumble_url[0], 'ie_key': RumbleEmbedIE.ie_key()}
        else:
            youtube_url = list(YoutubeIE._extract_embed_urls(url, webpage))
            if youtube_url:
                info = {'url': youtube_url[0], 'ie_key': YoutubeIE.ie_key()}
        if not info:
            raise ExtractorError('No videos found on webpage', expected=True)

        return {
            **info,
            '_type': 'url_transparent',
            'description': strip_or_none(self._search_regex(
                r'(?s)(.+)About the Author', clean_html(get_element_by_class('video-desc-paragraph', webpage)),
                'description', default=None))
        }