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

Code before:
            'uploader': 'Merryweather Comics',
            'thumbnail': 'https://data-1.utreon.com/v/MT/E4/Zj/Y-stEH-FBm8/Y-stEH-FBm8_5290676a41a4a1096db133b09f54f77b_cover.jpg',
            'release_date': '20210718',
        }},
    ]

    _formats = {
        'video_144p_url': 144,
        'video_240p_url': 240,
        'video_360p_url': 360,
        'video_480p_url': 480,
        'video_720p_url': 720,
        'video_1080p_url': 1080,
    }

    def _real_extract(self, url):
        video_id = self._match_id(url)
        json_data = self._download_json(
            'https://api.utreon.com/v1/videos/' + video_id,
            video_id)
        videos_json = json_data['videos']
        formats = [{
            'url': videos_json[format_key],
            'format_id': '%dp' % self._formats[format_key],
            'height': self._formats[format_key],
        } for format_key in list(videos_json.keys())]
        self._sort_formats(formats)
        thumbnail = url_or_none(json_data.get('cover_image_url'))\
            if url_or_none(json_data.get('cover_image_url'))\
            else url_or_none(json_data.get('preview_image_url'))

        return {
            'id': video_id,
            'title': json_data['title'],
            'formats': formats,
            'description': str_or_none(json_data.get('description')),
            'duration': int_or_none(json_data.get('duration')),
            'uploader': str_or_none(try_get(json_data, lambda x: x['channel']['title'])),
            'thumbnail': thumbnail,
            'release_date': unified_strdate(json_data.get('published_datetime')),
        }


Review comment (suggestion):
```suggestion
        formats = [{
            'url': url_or_none(url),
            'format_id': '%dp' % self._formats[format_key],
            'height': self._formats[format_key],
        } for format_key, url in videos_json.items() if url_or_none(url)]
```

Code after:
            'description': 'md5:7a48450b0d761b96dec194be0c5ecb5f',
            'uploader': 'Merryweather Comics',
            'thumbnail': 'https://data-1.utreon.com/v/MT/E4/Zj/Y-stEH-FBm8/Y-stEH-FBm8_5290676a41a4a1096db133b09f54f77b_cover.jpg',
            'release_date': '20210718',
        }},
    ]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        json_data = self._download_json(
            'https://api.utreon.com/v1/videos/' + video_id,
            video_id)
        videos_json = json_data['videos']
        formats = [{
            'url': format_url,
            'format_id': format_key.split('_')[1],
            'height': int(format_key.split('_')[1][:-1]),
        } for format_key, format_url in videos_json.items() if url_or_none(format_url)]
        self._sort_formats(formats)
        thumbnail = url_or_none(dict_get(json_data, ('cover_image_url', 'preview_image_url')))
        return {
            'id': video_id,
            'title': json_data['title'],
            'formats': formats,
            'description': str_or_none(json_data.get('description')),
            'duration': int_or_none(json_data.get('duration')),
            'uploader': str_or_none(try_get(json_data, lambda x: x['channel']['title'])),
            'thumbnail': thumbnail,
            'release_date': unified_strdate(json_data.get('published_datetime')),
        }