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

Code before:
    }, {
        'url': 'https://rumble.com/live-videos',
        'playlist_mincount': 19,
        'info_dict': {
            'id': 'live-videos',
            'title': 'Live Videos',
            'description': 'Live videos on Rumble.com',
            'age_limit': 0,
        },
    }, {
        'url': 'https://rumble.com/search/video?q=rumble&sort=views',
        'playlist_count': 24,
        'info_dict': {
            'id': 'video?q=rumble&sort=views',
            'title': 'Search results for: rumble',
            'age_limit': 0,
        },
    }]

    def _real_extract(self, url):
        page_id = self._match_id(url)
        webpage = self._download_webpage(url, page_id)

        rumble_embed = self._downloader.get_info_extractor(RumbleEmbedIE.ie_key())
        try:
            url_info = next(rumble_embed.extract_from_webpage(self._downloader, url, webpage))
        except StopIteration:
            raise UnsupportedError(url)
        info = rumble_embed.extract(url_info['url'])
        release_ts_str = self._search_regex(
            r'(?:Livestream begins|Streamed on):\s+<time datetime="([^"]+)',
            webpage, 'release date', fatal=False, default=None)
        view_count_str = self._search_regex(r'<span class="media-heading-info">([\d,]+) Views',
                                            webpage, 'view count', fatal=False, default=None)
        info.update({
            'release_timestamp': parse_iso8601(release_ts_str),
            'view_count': parse_count(view_count_str),
            'like_count': parse_count(get_element_by_class('rumbles-count', webpage)),
            'description': clean_html(get_element_by_class('media-description', webpage)),
        })

        return info


class RumbleChannelIE(InfoExtractor):
    _VALID_URL = r'(?P<url>https?://(?:www\.)?rumble\.com/(?:c|user)/(?P<id>[^&?#$/]+))'

    _TESTS = [{
        'url': 'https://rumble.com/c/Styxhexenhammer666',
        'playlist_mincount': 1160,
        'info_dict': {

Review comment (refactor):
```suggestion
        try:
            url_info = next(RumbleEmbedIE.extract_from_webpage(self._downloader, url, webpage))
```

Code after:
    }, {
        'url': 'https://rumble.com/search/video?q=rumble&sort=views',
        'playlist_count': 24,
        'info_dict': {
            'id': 'video?q=rumble&sort=views',
            'title': 'Search results for: rumble',
            'age_limit': 0,
        },
    }]

    def _real_extract(self, url):
        page_id = self._match_id(url)
        webpage = self._download_webpage(url, page_id)
        url_info = next(RumbleEmbedIE.extract_from_webpage(self._downloader, url, webpage), None)
        if not url_info:
            raise UnsupportedError(url)

        release_ts_str = self._search_regex(
            r'(?:Livestream begins|Streamed on):\s+<time datetime="([^"]+)',
            webpage, 'release date', fatal=False, default=None)
        view_count_str = self._search_regex(r'<span class="media-heading-info">([\d,]+) Views',
                                            webpage, 'view count', fatal=False, default=None)

        return self.url_result(
            url_info['url'], ie_key=url_info['ie_key'], url_transparent=True,
            view_count=parse_count(view_count_str),
            release_timestamp=parse_iso8601(release_ts_str),
            like_count=parse_count(get_element_by_class('rumbles-count', webpage)),
            description=clean_html(get_element_by_class('media-description', webpage)),
        )


class RumbleChannelIE(InfoExtractor):
    _VALID_URL = r'(?P<url>https?://(?:www\.)?rumble\.com/(?:c|user)/(?P<id>[^&?#$/]+))'

    _TESTS = [{
        'url': 'https://rumble.com/c/Styxhexenhammer666',
        'playlist_mincount': 1160,
        'info_dict': {
            'id': 'Styxhexenhammer666',
        },
    }, {
        'url': 'https://rumble.com/user/goldenpoodleharleyeuna',
        'playlist_mincount': 4,
        'info_dict': {
            'id': 'goldenpoodleharleyeuna',
        },
    }]

    def entries(self, url, playlist_id):
        for page in itertools.count(1):