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

Code before:
            default=(0, 0))
        if not max_dimensions[0]:
            return thumbnails
        return [
            merge_dicts(
                {'url': re.sub(url_width_re, str(max_dimensions[0]), thumbnail['url'])},
                dict(zip(_keys, max_dimensions)), thumbnail)
            for thumbnail in thumbnails
        ]

    def _download_and_extract_api_data(self, video_id, netloc, cid=None):
        url = f'{self.http_scheme()}//{netloc}{self._API_PATH}'
        info = self._download_json(url, video_id, query={'cid': cid or video_id})
        try:
            source = info['url']
        except KeyError:
            raise ExtractorError('no source found for %s' % video_id)
        formats, subs = self._extract_m3u8_formats_and_subtitles(
            source, video_id, 'mp4') \
            if determine_ext(source) == 'm3u8' else ([{'url': source}], {})
        self._sort_formats(formats)
        thumbnails = self._scale_thumbnails_to_max_width(
            formats, [{'url': info['thumb']}], r'(?<=/imgHandler/)\d+')
        return {
            'id': video_id,
            'title': info['title'],
            'thumbnails': thumbnails,
            'formats': formats,
            'subtitles': subs,
        }


class Ant1NewsGrWatchIE(Ant1NewsGrBaseIE):
    IE_NAME = 'ant1newsgr:watch'
    IE_DESC = 'ant1news.gr videos'
    _VALID_URL = r'https?://(?P<netloc>(?:www\.)?ant1news\.gr)/watch/(?P<id>\d+)/'
    _API_PATH = '/templates/data/player'

    _TEST = {
        'url': 'https://www.ant1news.gr/watch/1506168/ant1-news-09112021-stis-18-45',
        'md5': '95925e6b32106754235f2417e0d2dfab',
        'info_dict': {
            'id': '1506168',
            'ext': 'mp4',
            'title': 'md5:0ad00fa66ecf8aa233d26ab0dba7514a',
            'description': 'md5:18665af715a6dcfeac1d6153a44f16b0',
            'thumbnail': 'https://ant1media.azureedge.net/imgHandler/640/26d46bf6-8158-4f02-b197-7096c714b2de.jpg',
        },
    }

    def _real_extract(self, url):

Review comment (suggestion):
```suggestion
            'title': info.get('title'),
```
due to some recent changes, this is now more appropriate

Code after:
        except KeyError:
            raise ExtractorError('no source found for %s' % video_id)
        formats, subs = (self._extract_m3u8_formats_and_subtitles(source, video_id, 'mp4')
                         if determine_ext(source) == 'm3u8' else ([{'url': source}], {}))
        self._sort_formats(formats)
        thumbnails = scale_thumbnails_to_max_format_width(
            formats, [{'url': info['thumb']}], r'(?<=/imgHandler/)\d+')
        return {
            'id': video_id,
            'title': info.get('title'),
            'thumbnails': thumbnails,
            'formats': formats,
            'subtitles': subs,
        }


class Ant1NewsGrWatchIE(Ant1NewsGrBaseIE):
    IE_NAME = 'ant1newsgr:watch'
    IE_DESC = 'ant1news.gr videos'
    _VALID_URL = r'https?://(?P<netloc>(?:www\.)?ant1news\.gr)/watch/(?P<id>\d+)/'
    _API_PATH = '/templates/data/player'

    _TESTS = [{
        'url': 'https://www.ant1news.gr/watch/1506168/ant1-news-09112021-stis-18-45',
        'md5': '95925e6b32106754235f2417e0d2dfab',
        'info_dict': {
            'id': '1506168',
            'ext': 'mp4',
            'title': 'md5:0ad00fa66ecf8aa233d26ab0dba7514a',
            'description': 'md5:18665af715a6dcfeac1d6153a44f16b0',
            'thumbnail': 'https://ant1media.azureedge.net/imgHandler/640/26d46bf6-8158-4f02-b197-7096c714b2de.jpg',
        },
    }]

    def _real_extract(self, url):
        video_id, netloc = self._match_valid_url(url).group('id', 'netloc')
        webpage = self._download_webpage(url, video_id)
        info = self._download_and_extract_api_data(video_id, netloc)
        info['description'] = self._og_search_description(webpage)
        return info


class Ant1NewsGrArticleIE(Ant1NewsGrBaseIE):
    IE_NAME = 'ant1newsgr:article'
    IE_DESC = 'ant1news.gr articles'
    _VALID_URL = r'https?://(?:www\.)?ant1news\.gr/[^/]+/article/(?P<id>\d+)/'

    _TESTS = [{
        'url': 'https://www.ant1news.gr/afieromata/article/549468/o-tzeims-mpont-sta-meteora-oi-apeiles-kai-o-xesikomos-ton-kalogeron',
        'md5': '294f18331bb516539d72d85a82887dcc',
        'info_dict': {