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

Code before:
                })

        return formats

    def _real_extract(self, url):
        mobj = self._match_valid_url(url)
        video_id = mobj.group('id')

        if 'cdn' not in mobj.groupdict():
            raise ExtractorError('CDN not found in url: %s' % url)

        # for leitv/youreporter don't use the embed page
        if mobj.group('cdn') not in ['leitv.it', 'youreporter.it']:
            if 'video-embed' not in url and not re.match(self._UUID_RE, video_id):
                page = self._download_webpage(url, video_id)
                video_id = self._search_regex(fr'"uuid"\s*:\s*"({self._UUID_RE})"', page, video_id, fatal=False) or video_id
            url = 'https://video.%s/video-embed/%s' % (mobj.group('cdn'), video_id)

        page = self._download_webpage(url, video_id)
        video_data = None
        # look for json video data url
        json = self._search_regex(
            r'''(?x)url\s*=\s*(["'])
            (?P<url>
                (?:https?:)?//video\.rcs\.it
                /fragment-includes/video-includes/\S+?\.json
            )\1;''',
            page, video_id, group='url', default=None)

        if json:
            video_data = self._download_json(sanitize_url(json, scheme='https'), video_id)
            video_id = video_data.get('id') or video_id

        # if json url not found, look for json video data directly in the page
        else:
            # RCS normal pages and most of the embeds
            json = self._search_regex(
                r'[\s;]video\s*=\s*({[\s\S]+?})(?:;|,playlist=)',
                page, video_id, default=None)
            if not json and 'video-embed' in url:
                page = self._download_webpage(url.replace('video-embed', 'video-json'), video_id)
                json = self._search_regex(
                    r'##start-video##({[\s\S]+?})##end-video##',
                    page, video_id, default=None)
            if not json:
                # if no video data found try search for iframes
                emb = RCSEmbedsIE._extract_url(page)
                if emb:
                    return {
                        '_type': 'url_transparent',
                        'url': emb,

Review comment (suggestion):
```suggestion
                /fragment-includes/video-includes/[^"']+?\.json
```

Code after:
                if data_config.get('newspaper'):
                    cdn = f'{data_config["newspaper"]}.it'
                display_id, video_id = video_id, data_config.get('uuid') or video_id
                url = f'https://video.{cdn}/video-json/{video_id}'
            else:
                json_url = self._search_regex(
                    r'''(?x)url\s*=\s*(["'])
                    (?P<url>
                        (?:https?:)?//video\.rcs\.it
                        /fragment-includes/video-includes/[^"']+?\.json
                    )\1;''',
                    webpage, video_id, group='url', default=None)
                if json_url:
                    video_data = self._download_json(sanitize_url(json_url, scheme='https'), video_id)
                    display_id, video_id = video_id, video_data.get('id') or video_id

        if not video_data:
            webpage = self._download_webpage(url, video_id)

            video_data = self._search_json(
                '##start-video##', webpage, 'video data', video_id, default=None,
                end_pattern='##end-video##', transform_source=js_to_json)

            if not video_data:
                # try search for iframes
                emb = RCSEmbedsIE._extract_url(webpage)
                if emb:
                    return {
                        '_type': 'url_transparent',
                        'url': emb,
                        'ie_key': RCSEmbedsIE.ie_key()
                    }

        if not video_data:
            raise ExtractorError('Video data not found in the page')

        return {
            'id': video_id,
            'display_id': display_id,
            'title': video_data.get('title'),
            'description': (clean_html(video_data.get('description'))
                            or clean_html(video_data.get('htmlDescription'))
                            or self._html_search_meta('description', webpage)),
            'uploader': video_data.get('provider') or cdn,
            'formats': list(self._create_formats(self._get_video_src(video_data), video_id)),
        }


class RCSEmbedsIE(RCSBaseIE):
    _VALID_URL = r'''(?x)
                    https?://(?P<vid>video)\.