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

Code before:
        }, {
            '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(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,
                'title': video.get('title'),
                'formats': formats,
                'subtitles': subtitles,
            }

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

        videos_info = self._search_json(
            r'jQuery\.extend\(Drupal\.settings\s*,',
            webpage, 'videos_info', page_id)['RRscheda']

        entries = list(self._entries(videos_info, page_id))


Review comment (refactor):
```suggestion
                fmts, subs = self._extract_m3u8_formats_and_subtitles(m3u8_url, video_id)
```

Hmm...

https://github.com/yt-dlp/yt-dlp/blob/a6783a3b9905e547f6c1d4df9d7c7999feda8afa/yt_dlp/extractor/common.py#L2038-L2048

Code after:
        }, {
            '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,
                'title': video.get('title'),
                'formats': formats,
                'subtitles': subtitles,
            }

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

        videos_info = self._search_json(
            r'jQuery\.extend\(Drupal\.settings\s*,',
            webpage, 'videos_info', page_id)['RRscheda']

        entries = list(self._entries(videos_info, page_id))