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

Code before:
            'upload_date': '20221130',
        }
    }]

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

        json = self._download_json(
            f'https://player.cloudycdn.services/player/{site_id}/media/{video_id}/',
            video_id, data=b'referer=https://embed.cloudycdn.services/')

        formats = []
        subtitles = {}
        for source in traverse_obj(json, ('source', 'sources'), default=[]):
            fmts, subs = self._extract_m3u8_formats_and_subtitles(source.get('src'), video_id)
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)

        return {
            'id': video_id,
            'title': json.get('name'),
            'formats': formats,
            'subtitles': subtitles,
            'duration': int_or_none(json.get('duration')),
            'timestamp': parse_iso8601(json.get('upload_date')),
            'thumbnail': traverse_obj(json, ('source', 'poster', {url_or_none})),
        }


Review comment (suggestion):
I would combine the metadata in to a single `traverse_obj` call:
```suggestion
            'formats': formats,
            'subtitles': subtitles,
            **traverse_obj(json, {
                'title': 'name',
                'duration': ('duration', {int_or_none}),
                'timestamp': ('upload_date', {parse_iso8601}),
                'thumbnail': ('source', 'poster', {url_or_none}),
            }),
```

Code after:
            'thumbnail': 'https://store.cloudycdn.services/tmsp00120/assets/media/488306/placeholder1679423604.jpg',
            'duration': 1205,
            'upload_date': '20221130',
        }
    }]
    _WEBPAGE_TESTS = [{
        'url': 'https://www.tavaklase.lv/video/es-esmu-mina-um-2/',
        'md5': '63074e8e6c84ac2a01f2fb8bf03b8f43',
        'info_dict': {
            'id': 'cqd_lib-2',
            'ext': 'mp4',
            'upload_date': '20230223',
            'duration': 629,
            'thumbnail': 'https://store.cloudycdn.services/tmsp00120/assets/media/518407/placeholder1678748124.jpg',
            'timestamp': 1677181513,
            'title': 'LIB-2',
        }
    }]

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

        data = self._download_json(
            f'https://player.cloudycdn.services/player/{site_id}/media/{video_id}/',
            video_id, data=urlencode_postdata({
                'version': '6.4.0',
                'referer': url,
            }))

        formats, subtitles = [], {}
        for m3u8_url in traverse_obj(data, ('source', 'sources', ..., 'src', {url_or_none})):
            fmts, subs = self._extract_m3u8_formats_and_subtitles(m3u8_url, video_id, fatal=False)
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)

        return {
            'id': video_id,
            'formats': formats,
            'subtitles': subtitles,
            **traverse_obj(data, {
                'title': ('name', {str}),
                'duration': ('duration', {int_or_none}),
                'timestamp': ('upload_date', {parse_iso8601}),
                'thumbnail': ('source', 'poster', {url_or_none}),
            }),
        }