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

Code before:
            self._extract_api_data(video, video_id)
            for video in videos
        ]
        return self.playlist_result(videos, video_id)

    def _extract_api_data(self, video, video_id):
        if video.get('error_code') == 'contentGeoblocked':
            self.raise_geo_restricted(countries=video['geo_locations'])
        info = self._extract_info(video, video_id)
        info['formats'], info['subtitles'] = self._extract_formats_and_subs(
            video, video_id)
        return info

    @staticmethod
    def _extract_info(video, video_id=None):
        def append_image_url(url, default='profile:player-960x540'):
            if url:
                return '%s/%s' % (url, default)
        thumbnail = append_image_url(try_get(video,
                                             lambda x: x['image']['url']))
        thumbnails = [
            dict(width=960, height=540,
                 **{k: append_image_url(v) if k == 'url' else v
                    for k, v in image.items() if k in ('id', 'url')})
            for image in video.get('images', [])
        ] or None

        return {
            'id': video.get('clip_id') or video_id,
            'title': video.get('title'),
            'description': video.get('description'),
            'thumbnail': thumbnail,
            'thumbnails': thumbnails,
            'duration': int_or_none(video.get('clip_duration')),
            'timestamp': video.get('created_at'),
        }

    def _extract_formats_and_subs(self, options, video_id):
        formats, subs = [], {}
        for format_id, format_url in options['source'].items():
            ext = determine_ext(format_url)
            if ext == 'm3u8':
                formats_, subs_ = self._extract_m3u8_formats_and_subtitles(
                    format_url, video_id, 'mp4', m3u8_id=format_id,
                    fatal=False)
                formats.extend(formats_)
                subs.update(subs_)
            else:
                formats.append({
                    'url': format_url,
                    'format_id': format_id,

Review comment (suggestion):
```suggestion
        thumbnails = [{
            'id': image.get('id'),
            'url': append_image_url(image['url']),
            'width': 960,
            'height': 540,
        } for image in video.get('images') or [] if image.get('url')]
```

Code after:
            self.raise_geo_restricted(countries=video['geo_locations'])

        formats, subs = [], {}
        for format_id, format_url in video['source'].items():
            ext = determine_ext(format_url)
            if ext == 'm3u8':
                formats_, subs_ = self._extract_m3u8_formats_and_subtitles(
                    format_url, video_id, 'mp4', m3u8_id=format_id,
                    fatal=False)
                formats.extend(formats_)
                subs.update(subs_)
            else:
                formats.append({
                    'url': format_url,
                    'format_id': format_id,
                })
        if video.get('language'):
            for fmt in formats:
                fmt['language'] = video['language']
        self._sort_formats(formats)

        images = (video.get('images') or []) + [video.get('image') or {}]
        thumbnails = [{
            'id': image.get('id'),
            'url': f'{image["url"]}/profile:player-960x540',
            'width': 960,
            'height': 540,
        } for image in images if image.get('url')]
        self._remove_duplicate_formats(thumbnails)

        return {
            'id': video.get('clip_id') or video_id,
            'title': video.get('title'),
            'description': video.get('description'),
            'thumbnails': thumbnails,
            'duration': int_or_none(video.get('clip_duration')),
            'timestamp': video.get('created_at'),
            'formats': formats,
            'subtitles': subs,
        }


class GlomexIE(GlomexBaseIE):
    IE_NAME = 'glomex'
    IE_DESC = 'Glomex videos'
    _VALID_URL = r'https?://video\.glomex\.com/[^/]+/(?P<id>v-[^-]+)'
    _INTEGRATION_ID = '19syy24xjn1oqlpc'

    _TESTS = [{
        'url': 'https://video.glomex.com/sport/v-cb24uwg77hgh-nach-2-0-sieg-guardiola-mit-mancity-vor-naechstem-titel',
        'md5': 'cec33a943c4240c9cb33abea8c26242e',