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

Code before:
        },
        'playlist_mincount': 20,
    }]

    def _real_extract(self, url):
        video_id, category = self._match_valid_url(url).group('id', 'category')
        webpage = self._download_webpage(url, video_id)

        hydration = self._search_json(
            r'window.__RTVCPLAY_STATE__\s*=', webpage, 'hydration', video_id, transform_source=js_to_json)

        asset_id = traverse_obj(hydration, ('content', 'currentContent', 'video', 'assetid'))
        if asset_id:
            hls_url = hydration['content']['currentContent']['base_url_hls'].replace('[node:field_asset_id]', asset_id)
        else:
            hls_url = traverse_obj(hydration, ('content', 'currentContent', 'channel', 'hls'))

        metadata = {
            'thumbnail': traverse_obj(
                hydration, ('content', 'currentContent', 'channel', 'image', 'logo', 'path'),
                ('content', 'currentContent', 'resource', 'image', 'cover_desktop', 'path')),
            **traverse_obj(hydration, ('content', 'currentContent', {
                'title': 'title',
                'description': 'description',
            })),
        }

        # Probably it's a program's page
        if not hls_url:
            seasons = traverse_obj(
                hydration, ('content', 'currentContent', 'widgets', lambda _, y: y['type'] == 'seasonList', 'contents'),
                get_all=False)
            if not seasons:
                podcast_episodes = traverse_obj(hydration, ('content', 'currentContent', 'audios'))
                if not podcast_episodes:
                    raise ExtractorError('Could not find asset_id nor program playlist nor podcast episodes')

                return self.playlist_result([self.url_result(episode['file'], **traverse_obj(episode, {
                    'title': 'title',
                    'description': 'description',
                    'episode_number': ('chapter_number', {lambda x: int_or_none(float_or_none(x))}),
                    'season_number': 'season',
                })) for episode in podcast_episodes], video_id, **metadata)

            entries = []
            for season in seasons:
                for episode in season['contents']:
                    entries.append(self.url_result(urljoin(url, episode['slug']), **{
                        **traverse_obj(season, {
                            'season': 'title',
                            'season_number': 'season',

Review comment (suggestion):
```suggestion
        metadata = traverse_obj(hydration, ('content', 'currentContent', {
            'title': 'title',
            'description': 'description',
            'thumbnail': ((('channel', 'image', 'logo'), ('resource', 'image', 'cover_desktop')), 'path'),
        }), get_all=False)
```

Code after:
        'info_dict': {
            'id': 'diez-versiones',
            'title': 'Diez versiones',
            'description': 'md5:997471ed971cb3fd8e41969457675306',
            'thumbnail': r're:^https?://.*\.(?:jpg|png)',
        },
        'playlist_mincount': 20,
    }]

    def _real_extract(self, url):
        video_id, category = self._match_valid_url(url).group('id', 'category')
        webpage = self._download_webpage(url, video_id)

        hydration = self._search_json(
            r'window\.__RTVCPLAY_STATE__\s*=', webpage, 'hydration',
            video_id, transform_source=js_to_json)['content']['currentContent']

        asset_id = traverse_obj(hydration, ('video', 'assetid'))
        if asset_id:
            hls_url = hydration['base_url_hls'].replace('[node:field_asset_id]', asset_id)
        else:
            hls_url = traverse_obj(hydration, ('channel', 'hls'))

        metadata = traverse_obj(hydration, {
            'title': 'title',
            'description': 'description',
            'thumbnail': ((('channel', 'image', 'logo'), ('resource', 'image', 'cover_desktop')), 'path'),
        }, get_all=False)

        # Probably it's a program's page
        if not hls_url:
            seasons = traverse_obj(
                hydration, ('widgets', lambda _, y: y['type'] == 'seasonList', 'contents'),
                get_all=False)
            if not seasons:
                podcast_episodes = hydration.get('audios')
                if not podcast_episodes:
                    raise ExtractorError('Could not find asset_id nor program playlist nor podcast episodes')

                return self.playlist_result([
                    self.url_result(episode['file'], url_transparent=True, **traverse_obj(episode, {
                        'title': 'title',
                        'description': ('description', {clean_html}),
                        'episode_number': ('chapter_number', {float_or_none}, {int_or_none}),
                        'season_number': ('season', {int_or_none}),
                    })) for episode in podcast_episodes], video_id, **metadata)

            entries = [self.url_result(
                urljoin(url, episode['slug']), url_transparent=True,
                **traverse_obj(season, {
                    'season': 'title',