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

Code before:
            start_pattern='var ilpostpodcast = ',
            end_pattern=';',
            string=webpage,
            name='endpoint-metadata',
            video_id=podcast_display_id,
        )
        episode_id = endpoint_metadata['post_id']
        podcast_id = endpoint_metadata['podcast_id']
        podcast_metadata = self._download_json(endpoint_metadata['ajax_url'], podcast_display_id, data=urlencode_postdata({
            'action': 'checkpodcast',
            'cookie': endpoint_metadata['cookie'],
            'post_id': episode_id,
            'podcast_id': podcast_id,
        }))
        episode = traverse_obj(podcast_metadata, (
            'data', 'postcastList', lambda _, v: str(v['id']) == episode_id, {dict}), get_all=False)
        if not episode:
            raise ExtractorError('Episode could not be extracted')
        return {
            'id': episode_id,
            'display_id': podcast_display_id,
            'series_id': podcast_id,
            'vcodec': 'none',
            **traverse_obj(episode, {
                'title': 'title',
                'description': 'description',
                'url': ('podcast_raw_url', {url_or_none}),
                'thumbnail': ('image', {url_or_none}),
                'timestamp': ('timestamp', {int_or_none}),
                'duration': ('milliseconds', {functools.partial(float_or_none, scale=1000)}),
                'availability': ('free', {lambda v: 'public' if v else 'subscriber_only'}),
            }),
        }


Review comment (suggestion):
```suggestion
                'title': ('title', {str}),
                'description': ('description', {str}),
```

Code after:

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

        endpoint_metadata = self._search_json(
            r'var\s+ilpostpodcast\s*=', webpage, 'metadata', display_id)
        episode_id = endpoint_metadata['post_id']
        podcast_id = endpoint_metadata['podcast_id']
        podcast_metadata = self._download_json(
            endpoint_metadata['ajax_url'], display_id, data=urlencode_postdata({
                'action': 'checkpodcast',
                'cookie': endpoint_metadata['cookie'],
                'post_id': episode_id,
                'podcast_id': podcast_id,
            }))

        episode = traverse_obj(podcast_metadata, (
            'data', 'postcastList', lambda _, v: str(v['id']) == episode_id, {dict}), get_all=False)
        if not episode:
            raise ExtractorError('Episode could not be extracted')

        return {
            'id': episode_id,
            'display_id': display_id,
            'series_id': podcast_id,
            'vcodec': 'none',
            **traverse_obj(episode, {
                'title': ('title', {str}),
                'description': ('description', {str}),
                'url': ('podcast_raw_url', {url_or_none}),
                'thumbnail': ('image', {url_or_none}),
                'timestamp': ('timestamp', {int_or_none}),
                'duration': ('milliseconds', {functools.partial(float_or_none, scale=1000)}),
                'availability': ('free', {lambda v: 'public' if v else 'subscriber_only'}),
            }),
        }