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

Code before:
        video_info = self._search_json(
            r'jQuery\.extend\(Drupal\.settings\s*,',
            webpage, 'video_info', video_id)['RRscheda']
        json_ld = self._search_json_ld(webpage, video_id)

        formats = []
        for source in traverse_obj(video_info, ('playlist', 0, 'sources')):
            formats.extend(
                self._extract_m3u8_formats(source.get('src'), video_id))

        subtitles = {}
        for sub in traverse_obj(video_info, ('playlist', 0, 'subtitles')):
            self._merge_subtitles({sub.get('srclang') or 'und': [{
                'url': sub.get('src'),
                'name': sub.get('label'),
            }]}, target=subtitles)

        return {
            'id': video_id,
            'formats': formats,
            'subtitles': subtitles,
            'title': json_ld.get('title') or self._og_search_title(webpage),
            'location': video_info.get('luogo'),
            'timestamp': json_ld.get('timestamp'),
            'thumbnail': traverse_obj(json_ld, ('thumbnails', 0, 'url', {url_or_none})),
            'description': json_ld.get('description') or self._og_search_description(webpage),
        }


Review comment (refactor):
Let's simplify and inline the `_search_json_ld` call.
```suggestion
            'title': self._og_search_title(webpage),
            'location': video_info.get('luogo'),
            'description': self._og_search_description(webpage),
            **self._search_json_ld(webpage, video_id),
```

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