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

Code before:
            'duration': 901,
            'release_timestamp': 1404777600,
            'release_date': '20140708',
        },
        'expected_warnings': ['The stream has AES-128 encryption and neither ffmpeg nor pycryptodomex are available; Decryption will be performed natively, but will be extremely slow'],
    }, {
        'url': 'https://www.fifa.com/fifaplus/fr/watch/3C6gQH9C2DLwzNx7BMRQdp',
        'info_dict': {
            'id': '3C6gQH9C2DLwzNx7BMRQdp',
            'title': 'Le but de Josimar contre le Irlande du Nord | Buts classiques',
            'description': 'md5:16f9f789f09960bfe7220fe67af31f34',
            'ext': 'mp4',
            'categories': ['FIFA Tournaments', 'Goal'],
            'duration': 28,
            'thumbnail': 'https://digitalhub.fifa.com/transform/f9301391-f8d9-48b5-823e-c093ac5e3e11/CG_MEN_1986_JOSIMAR',
        },
        'expected_warnings': ['The stream has AES-128 encryption and neither ffmpeg nor pycryptodomex are available; Decryption will be performed natively, but will be extremely slow'],
    }]

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

        preconnect_link = self._search_regex(r'<link[^>]+?rel\s*=\s*"preconnect"[^>]+href\s*=\s*"([^"]+)"', webpage, 'Preconnect Link')

        json_data = self._download_json(f'{preconnect_link}/video/GetVideoPlayerData/{video_id}',
                                        video_id, 'Downloading Video Player Data', query={'includeIdents': True, 'locale': locale})

        video_details = self._download_json(f'{preconnect_link}/sections/videoDetails/{video_id}', video_id, 'Downloading Video Details', fatal=False)

        preplay_parameters = self._download_json(
            f'{preconnect_link}/video/GetVerizonPreplayParameters', video_id, 'Downloading Preplay Parameters', query={
                'entryId': video_id,
                'assetId': json_data.get('verizonAssetId'),
                'useExternalId': False,
                'requiresToken': json_data.get('requiresToken'),
                'adConfig': 'fifaplusvideo',
                'prerollAds': True,
                'adVideoId': json_data.get('externalVerizonAssetId'),
                'preIdentId': json_data.get('preIdentId'),
                'postIdentId': json_data.get('postIdentId'),
            })

        cid = f'{json_data.get("preIdentId")},{json_data.get("verizonAssetId")},{json_data.get("postIdentId")}'
        content_data = self._download_json(
            f'https://content.uplynk.com/preplay/{cid}/multiple.json', video_id, 'Downloading Content Data', query={
                'v': preplay_parameters.get('preplayAPIVersion'),
                'tc': preplay_parameters.get('tokenCheckAlgorithmVersion'),
                'rn': preplay_parameters.get('randomNumber'),

Review comment (suggestion):
```suggestion
        preconnect_link = self._search_regex(r'<link[^>]+rel\s*=\s*"preconnect"[^>]+href\s*=\s*"([^"]+)"', webpage, 'Preconnect Link')
```

Code after:
            'duration': 901,
            'release_timestamp': 1404777600,
            'release_date': '20140708',
        },
        'params': {'skip_download': 'm3u8'},
    }, {
        'url': 'https://www.fifa.com/fifaplus/fr/watch/3C6gQH9C2DLwzNx7BMRQdp',
        'info_dict': {
            'id': '3C6gQH9C2DLwzNx7BMRQdp',
            'title': 'Le but de Josimar contre le Irlande du Nord | Buts classiques',
            'description': 'md5:16f9f789f09960bfe7220fe67af31f34',
            'ext': 'mp4',
            'categories': ['FIFA Tournaments', 'Goal'],
            'duration': 28,
            'thumbnail': 'https://digitalhub.fifa.com/transform/f9301391-f8d9-48b5-823e-c093ac5e3e11/CG_MEN_1986_JOSIMAR',
        },
        'params': {'skip_download': 'm3u8'},
    }]

    def _real_extract(self, url):
        video_id, locale = self._match_valid_url(url).group('id', 'locale')
        webpage = self._download_webpage(url, video_id)

        preconnect_link = self._search_regex(
            r'<link[^>]+rel\s*=\s*"preconnect"[^>]+href\s*=\s*"([^"]+)"', webpage, 'Preconnect Link')

        json_data = self._download_json(
            f'{preconnect_link}/video/GetVideoPlayerData/{video_id}', video_id,
            'Downloading Video Player Data', query={'includeIdents': True, 'locale': locale})

        video_details = self._download_json(
            f'{preconnect_link}/sections/videoDetails/{video_id}', video_id, 'Downloading Video Details', fatal=False)

        preplay_parameters = self._download_json(
            f'{preconnect_link}/video/GetVerizonPreplayParameters', video_id, 'Downloading Preplay Parameters', query={
                'entryId': video_id,
                'assetId': json_data['verizonAssetId'],
                'useExternalId': False,
                'requiresToken': json_data['requiresToken'],
                'adConfig': 'fifaplusvideo',
                'prerollAds': True,
                'adVideoId': json_data['externalVerizonAssetId'],
                'preIdentId': json_data['preIdentId'],
                'postIdentId': json_data['postIdentId'],
            })

        cid = f'{json_data["preIdentId"]},{json_data["verizonAssetId"]},{json_data["postIdentId"]}'
        content_data = self._download_json(
            f'https://content.uplynk.com/preplay/{cid}/multiple.json', video_id, 'Downloading Content Data', query={
                'v': preplay_parameters['preplayAPIVersion'],
                'tc': preplay_parameters['tokenCheckAlgorithmVersion'],