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

Code before:
        'url': 'https://www.cnnindonesia.com/internasional/20220911104341-139-846189/video-momen-charles-disambut-meriah-usai-dilantik-jadi-raja-inggris',
        'info_dict': {
            'id': '846189',
            'ext': 'mp4',
            'upload_date': '20220911',
            'duration': 76.0,
            'timestamp': 1662869995,
            'description': 'md5:ece7b003b3ee7d81c6a5cfede7d5397d',
            'thumbnail': r're:https://akcdn\.detik\.net\.id/visual/2022/09/11/thumbnail-video-1_169\.jpeg',
            'title': 'VIDEO: Momen Charles Disambut Meriah usai Dilantik jadi Raja Inggris',
            'tags': ['raja charles', 'raja charles iii', 'ratu elizabeth', 'ratu elizabeth meninggal dunia', 'raja inggris', 'inggris'],
            'age_limit': 0,
            'release_date': '20220911',
            'uploader': 'REUTERS',
            'release_timestamp': 1662869995,
            'subtitle': {},
        }
    }]

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

        json_ld_data = self._search_json_ld(webpage, display_id)
        json_ld_list = list(self._yield_json_ld(webpage, display_id))
        embed_url = [json_ld.get('embedUrl') for json_ld in json_ld_list if json_ld.get('@type') == 'VideoObject'][0]

        return self.url_result(
            embed_url, video_id=video_id, upload_date=upload_date, url_transparent=True,
            tags=str_or_none(self._html_search_meta('keywords', webpage), '').split(', '), **json_ld_data)


Review comment (suggestion):
```suggestion
        json_ld_list_ = list(self._yield_json_ld(html, video_id))
        json_ld_data = self._json_ld(json_ld_list_, display_id)
        embed_url = next(
            json_ld.get('embedUrl') for json_ld in json_ld_list if json_ld.get('@type') == 'VideoObject')
```

Code after:
        'info_dict': {
            'id': '846189',
            'ext': 'mp4',
            'upload_date': '20220911',
            'duration': 76.0,
            'timestamp': 1662869995,
            'description': 'md5:ece7b003b3ee7d81c6a5cfede7d5397d',
            'thumbnail': r're:https://akcdn\.detik\.net\.id/visual/2022/09/11/thumbnail-video-1_169\.jpeg',
            'title': 'VIDEO: Momen Charles Disambut Meriah usai Dilantik jadi Raja Inggris',
            'tags': ['raja charles', 'raja charles iii', 'ratu elizabeth', 'ratu elizabeth meninggal dunia', 'raja inggris', 'inggris'],
            'age_limit': 0,
            'release_date': '20220911',
            'uploader': 'REUTERS',
            'release_timestamp': 1662869995,
        }
    }]

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

        json_ld_list = list(self._yield_json_ld(webpage, display_id))
        json_ld_data = self._json_ld(json_ld_list, display_id)
        embed_url = next(
            json_ld.get('embedUrl') for json_ld in json_ld_list if json_ld.get('@type') == 'VideoObject')

        return merge_dicts(json_ld_data, {
            '_type': 'url_transparent',
            'url': embed_url,
            'upload_date': upload_date,
            'tags': try_call(lambda: self._html_search_meta('keywords', webpage).split(', '))
        })