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

Code before:
                    f'https://medium.ngtv.io/v2/media/{media_id}/desktop', media_id, fatal=False,
                    query={'appId': app_id})
                m3u8_url = traverse_obj(media_data, (
                    'media', 'desktop', 'unprotected', 'unencrypted', 'url', {url_or_none}))
                if m3u8_url:
                    fmts, subs = self._extract_m3u8_formats_and_subtitles(
                        m3u8_url, media_id, 'mp4', m3u8_id='hls', fatal=False)
                    formats.extend(fmts)
                    self._merge_subtitles(subs, target=subtitles)

            entries.append({
                **traverse_obj(player_data, {
                    'title': ('data-headline', {clean_html}),
                    'description': ('data-description', {clean_html}),
                    'duration': ('data-duration', {parse_duration}),
                    'timestamp': ('data-publish-date', {parse_iso8601}),
                    'thumbnail': (
                        'data-poster-image-override', {json.loads}, 'big', 'uri', {url_or_none},
                        {functools.partial(update_url, query='c=original')}),
                    'display_id': 'data-video-slug',
                }),
                **traverse_obj(video_data, {
                    'timestamp': ('dateCreated', 'uts', {float_or_none(scale=1000)}),
                    'description': ('description', {clean_html}),
                    'title': ('headline', {str}),
                    'modified_timestamp': ('lastModified', 'uts', {float_or_none(scale=1000)}),
                    'duration': ('trt', {int_or_none}),
                }),
                'id': media_id,
                'formats': formats,
                'subtitles': subtitles,
            })

        if len(entries) == 1:
            return {
                **entries[0],
                'display_id': display_id,
            }

        return self.playlist_result(entries, display_id)


class CNNIndonesiaIE(InfoExtractor):
    _VALID_URL = r'https?://www\.cnnindonesia\.com/[\w-]+/(?P<upload_date>\d{8})\d+-\d+-(?P<id>\d+)/(?P<display_id>[\w-]+)'
    _TESTS = [{
        'url': 'https://www.cnnindonesia.com/ekonomi/20220909212635-89-845885/alasan-harga-bbm-di-indonesia-masih-disubsidi',
        'info_dict': {
            'id': '845885',
            'ext': 'mp4',
            'description': 'md5:e7954bfa6f1749bc9ef0c079a719c347',
            'upload_date': '20220909',

Review comment (suggestion):
I'd use `int_or_none` for the timestamps here to stay consistent with the fallback values
```suggestion
                    'timestamp': ('dateCreated', 'uts', {int_or_none(scale=1000)}),
                    'description': ('description', {clean_html}),
                    'title': ('headline', {str}),
                    'modified_timestamp': ('lastModified', 'uts', {int_or_none(scale=1000)}),
```

Code after:
                media_data = self._download_json(
                    f'https://medium.ngtv.io/v2/media/{media_id}/desktop', media_id, fatal=False,
                    query={'appId': app_id})
                m3u8_url = traverse_obj(media_data, (
                    'media', 'desktop', 'unprotected', 'unencrypted', 'url', {url_or_none}))
                if m3u8_url:
                    fmts, subs = self._extract_m3u8_formats_and_subtitles(
                        m3u8_url, media_id, 'mp4', m3u8_id='hls', fatal=False)
                    formats.extend(fmts)
                    self._merge_subtitles(subs, target=subtitles)

            entries.append({
                **traverse_obj(player_data, {
                    'title': ('data-headline', {clean_html}),
                    'description': ('data-description', {clean_html}),
                    'duration': ('data-duration', {parse_duration}),
                    'timestamp': ('data-publish-date', {parse_iso8601}),
                    'thumbnail': (
                        'data-poster-image-override', {json.loads}, 'big', 'uri', {url_or_none},
                        {functools.partial(update_url, query='c=original')}),
                    'display_id': 'data-video-slug',
                }),
                **traverse_obj(video_data, {
                    'timestamp': ('dateCreated', 'uts', {int_or_none(scale=1000)}),
                    'description': ('description', {clean_html}),
                    'title': ('headline', {str}),
                    'modified_timestamp': ('lastModified', 'uts', {int_or_none(scale=1000)}),
                    'duration': ('trt', {int_or_none}),
                }),
                'id': media_id,
                'formats': formats,
                'subtitles': subtitles,
            })

        if len(entries) == 1:
            return {
                **entries[0],
                'display_id': display_id,
            }

        return self.playlist_result(entries, display_id)


class CNNIndonesiaIE(InfoExtractor):
    _VALID_URL = r'https?://www\.cnnindonesia\.com/[\w-]+/(?P<upload_date>\d{8})\d+-\d+-(?P<id>\d+)/(?P<display_id>[\w-]+)'
    _TESTS = [{
        'url': 'https://www.cnnindonesia.com/ekonomi/20220909212635-89-845885/alasan-harga-bbm-di-indonesia-masih-disubsidi',
        'info_dict': {
            'id': '845885',
            'ext': 'mp4',
            'description': 'md5:e7954bfa6f1749bc9ef0c079a719c347',