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

Code before:
            '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,
        }
    }]

    def _real_extract(self, url):
        display_id = self._match_id(url)
        webpage = self._download_webpage(url, display_id)
        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')

        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))
        }


Review comment (suggestion):
There is no guarantee this is a list. You'd have to do `next(iter(...`. Or easier, just cast to `list` imo. Same for youtube

Code after:
            '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))
        }