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

Code before:
                article = traverse_obj(preload_state, (
                    'entities', 'articles', lambda _, v: v['assetVideo'][0] == asset_id, any))

                def image_url(image_id):
                    return traverse_obj(preload_state, (
                        'entities', 'images', image_id, 'url',
                        {lambda u: url_or_none(u.replace('$recipe', 'raw'))}))

                formats, subtitles = self._download_media_selector(video_id)
                return {
                    'id': video_id,
                    **traverse_obj(preload_state, ('entities', 'videos', asset_id, {
                        'title': ('title', {str}),
                        'description': (('synopsisLong', 'synopsisMedium', 'synopsisShort'), {str}, any),
                        'thumbnail': (0, {image_url}),
                        'duration': ('duration', {int_or_none}),
                    })),
                    'formats': formats,
                    'subtitles': subtitles,
                    **traverse_obj(article, {
                        'timestamp': ('displayDate', {parse_iso8601}),
                    }),
                }
            else:
                return self.url_result(
                    'https://www.bbc.co.uk/programmes/%s' % asset_id, BBCCoUkIE.ie_key(),
                    asset_id, playlist_title, display_id=playlist_id,
                    description=playlist_description)

        bbc3_config = self._parse_json(
            self._search_regex(
                r'(?s)bbcthreeConfig\s*=\s*({.+?})\s*;\s*<', webpage,
                'bbcthree config', default='{}'),
            playlist_id, transform_source=js_to_json, fatal=False) or {}
        payload = bbc3_config.get('payload') or {}
        if payload:
            clip = payload.get('currentClip') or {}
            clip_vpid = clip.get('vpid')
            clip_title = clip.get('title')
            if clip_vpid and clip_title:
                formats, subtitles = self._download_media_selector(clip_vpid)
                return {
                    'id': clip_vpid,
                    'title': clip_title,
                    'thumbnail': dict_get(clip, ('poster', 'imageUrl')),
                    'description': clip.get('description'),
                    'duration': parse_duration(clip.get('duration')),
                    'formats': formats,
                    'subtitles': subtitles,
                }
            bbc3_playlist = try_get(

Review comment (suggestion):
```suggestion
                    f'https://www.bbc.co.uk/programmes/{asset_id}', BBCCoUkIE,
```

Code after:
                        {lambda u: url_or_none(u.replace('$recipe', 'raw'))}))

                formats, subtitles = self._download_media_selector(video_id)
                return {
                    'id': video_id,
                    **traverse_obj(preload_state, ('entities', 'videos', asset_id, {
                        'title': ('title', {str}),
                        'description': (('synopsisLong', 'synopsisMedium', 'synopsisShort'), {str}, any),
                        'thumbnail': (0, {image_url}),
                        'duration': ('duration', {int_or_none}),
                    })),
                    'formats': formats,
                    'subtitles': subtitles,
                    'timestamp': traverse_obj(article, ('displayDate', {parse_iso8601})),
                }
            else:
                return self.url_result(
                    f'https://www.bbc.co.uk/programmes/{asset_id}', BBCCoUkIE,
                    asset_id, playlist_title, display_id=playlist_id,
                    description=playlist_description)

        bbc3_config = self._parse_json(
            self._search_regex(
                r'(?s)bbcthreeConfig\s*=\s*({.+?})\s*;\s*<', webpage,
                'bbcthree config', default='{}'),
            playlist_id, transform_source=js_to_json, fatal=False) or {}
        payload = bbc3_config.get('payload') or {}
        if payload:
            clip = payload.get('currentClip') or {}
            clip_vpid = clip.get('vpid')
            clip_title = clip.get('title')
            if clip_vpid and clip_title:
                formats, subtitles = self._download_media_selector(clip_vpid)
                return {
                    'id': clip_vpid,
                    'title': clip_title,
                    'thumbnail': dict_get(clip, ('poster', 'imageUrl')),
                    'description': clip.get('description'),
                    'duration': parse_duration(clip.get('duration')),
                    'formats': formats,
                    'subtitles': subtitles,
                }
            bbc3_playlist = try_get(
                payload, lambda x: x['content']['bbcMedia']['playlist'],
                dict)
            if bbc3_playlist:
                playlist_title = bbc3_playlist.get('title') or playlist_title
                thumbnail = bbc3_playlist.get('holdingImageURL')
                entries = []
                for bbc3_item in bbc3_playlist['items']:
                    programme_id = bbc3_item.get('versionID')