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

Code before:

    def _real_extract(self, url):
        setlocale(LC_ALL, '')

        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)

        video_info = self._parse_json(self._search_regex(
            r'jQuery\.extend\(Drupal\.settings\s*,\s*({.+?})\);',
            webpage, 'drupal settings'), video_id)['RRscheda']

        json_ld = list(self._yield_json_ld(webpage, video_id))[0]

        playlist = self._extract_m3u8_formats_and_subtitles(
            video_info['playlist'][0]['sources'][0]['src'], video_id)

        base_url = urlparse(video_info['playlist'][0]['sources'][0]['src'])._replace(
            params='', query='', fragment='')

        playlist[0][0]['fragment_base_url'] = \
            base_url._replace(path=dirname(base_url.path)).geturl()
        chunks = sub('#.*', '', self._download_webpage(
                     playlist[0][0]['url'], video_id, note='Downloading chunk list')).strip().split()
        playlist[0][0]['fragments'] = [{'path': chunk} for chunk in chunks]

        name_time = r' \| di&nbsp;(?P<creator>.+?) - (?P<location>.+?) - (?P<hour>\d+):(?P<minute>\d+)'

        return {
            'id': video_id,
            'formats': playlist[0],
            'title': video_info['playlist'][0]['title'],
            'creator': self._search_regex(name_time, webpage, 'creator', group='creator'),
            'location': video_info['luogo'],
            'timestamp': datetime.strptime(json_ld['uploadDate'], '%Y-%m-%d').replace(
                hour=int(self._search_regex(name_time, webpage, 'release hour', group='hour')),
                minute=int(self._search_regex(name_time, webpage, 'release minute', group='minute'))
            ).timestamp(),
            'thumbnail': json_ld['thumbnailUrl'],
            'description': json_ld['description'],
        }


Review comment (suggestion):
```py
        creator, time = self._search_regex(
            r' \| di&nbsp;(?P<creator>.+?) - (?:.+?) - (?P<time>\d+:\d+)'
            ...)
```

Code after:
            'id': '742783',
            'title': 'Parlamento riunito in seduta comune (11ª della XIX legislatura)',
            'description': '-) Votazione per l\'elezione di un giudice della Corte Costituzionale (nono scrutinio)',
            'location': 'CAMERA',
            'duration': 5868.0,
            'timestamp': 1730246400,
            'upload_date': '20241030',
        },
        'playlist': [{
            'md5': 'aa48de55dcc45478e4cd200f299aab7d',
            'info_dict': {
                'id': '742783-0',
                'ext': 'mp4',
                'title': 'Parlamento riunito in seduta comune (11ª della XIX legislatura)',
            },
        }, {
            'md5': 'be915c189c70ad2920e5810f32260ff5',
            'info_dict': {
                'id': '742783-1',
                'ext': 'mp4',
                'title': 'Parlamento riunito in seduta comune (11ª della XIX legislatura)',
            },
        }, {
            'md5': 'f0ee4047342baf8ed3128a8417ac5e0a',
            'info_dict': {
                'id': '742783-2',
                'ext': 'mp4',
                'title': 'Parlamento riunito in seduta comune (11ª della XIX legislatura)',
            },
        }],
    }]

    def _entries(self, videos_info, page_id):
        for idx, video in enumerate(traverse_obj(
                videos_info, ('playlist', lambda _, v: v['sources']))):
            video_id = f'{page_id}-{idx}'
            formats = []
            subtitles = {}

            for m3u8_url in traverse_obj(video, ('sources', ..., 'src', {url_or_none})):
                fmts, subs = self._extract_m3u8_formats_and_subtitles(m3u8_url, video_id)
                formats.extend(fmts)
                self._merge_subtitles(subs, target=subtitles)
            for sub in traverse_obj(video, ('subtitles', ..., lambda _, v: url_or_none(v['src']))):
                self._merge_subtitles({sub.get('srclang') or 'und': [{
                    'url': sub['src'],
                    'name': sub.get('label'),
                }]}, target=subtitles)

            yield {
                'id': video_id,