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

Code before:
    ]

    def _extract_formats_and_subs(self, video_id):
        media_info = self._call_api(video_id, codename=video_id)
        formats, subtitles = [], {}
        for media in traverse_obj(media_info, (
                'MediaFiles', lambda _, v: v['RoleCodename'] == 'main',
                'Formats', lambda _, v: url_or_none(v['Url']))):
            fmt_url = media['Url']
            ext = determine_ext(fmt_url)
            if ext == 'm3u8':
                fmts, subs = self._extract_m3u8_formats_and_subtitles(
                    fmt_url, video_id, m3u8_id='hls', ext='mp4', fatal=False)
            elif ext == 'mpd':
                fmts, subs = self._extract_mpd_formats_and_subtitles(
                    fmt_url, video_id, mpd_id='dash', fatal=False)
            else:
                formats.append({
                    'url': fmt_url,
                    'format_id': str_or_none(media.get('Id')),
                })
                continue
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)

        return formats, subs

    def _real_extract(self, url):
        video_id = self._match_id(url)

        formats, subs = self._extract_formats_and_subs(video_id)

        if formats:
            return {
                'id': video_id,
                'formats': formats,
                'subtitles': subs,
                'title': self._generic_title(url),
            }


class ERTFlixIE(ERTFlixBaseIE):
    IE_NAME = 'ertflix'
    IE_DESC = 'ERTFLIX videos'
    _VALID_URL = r'https?://www\.ertflix\.gr/(?:[^/]+/)?(?:series|vod)/(?P<id>[a-z]{3}\.\d+)'
    _TESTS = [{
        'url': 'https://www.ertflix.gr/vod/vod.173258-aoratoi-ergates',
        'md5': '6479d5e60fd7e520b07ba5411dcdd6e7',
        'info_dict': {
            'id': 'aoratoi-ergates',
            'ext': 'mp4',

Review comment (suggestion):
```suggestion
        return formats, subtitles
```

Code after:
    ]

    def _extract_formats_and_subs(self, video_id):
        media_info = self._call_api(video_id, codename=video_id)
        formats, subtitles = [], {}
        for media in traverse_obj(media_info, (
                'MediaFiles', lambda _, v: v['RoleCodename'] == 'main',
                'Formats', lambda _, v: url_or_none(v['Url']))):
            fmt_url = media['Url']
            ext = determine_ext(fmt_url)
            if ext == 'm3u8':
                fmts, subs = self._extract_m3u8_formats_and_subtitles(
                    fmt_url, video_id, m3u8_id='hls', ext='mp4', fatal=False)
            elif ext == 'mpd':
                fmts, subs = self._extract_mpd_formats_and_subtitles(
                    fmt_url, video_id, mpd_id='dash', fatal=False)
            else:
                formats.append({
                    'url': fmt_url,
                    'format_id': str_or_none(media.get('Id')),
                })
                continue
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)

        return formats, subtitles

    def _real_extract(self, url):
        video_id = self._match_id(url)

        formats, subs = self._extract_formats_and_subs(video_id)

        if formats:
            return {
                'id': video_id,
                'formats': formats,
                'subtitles': subs,
                'title': self._generic_title(url),
            }


class ERTFlixIE(ERTFlixBaseIE):
    IE_NAME = 'ertflix'
    IE_DESC = 'ERTFLIX videos'
    _VALID_URL = r'https?://www\.ertflix\.gr/(?:[^/]+/)?(?:series|vod)/(?P<id>[a-z]{3}\.\d+)'
    _TESTS = [{
        'url': 'https://www.ertflix.gr/vod/vod.173258-aoratoi-ergates',
        'md5': '6479d5e60fd7e520b07ba5411dcdd6e7',
        'info_dict': {
            'id': 'aoratoi-ergates',
            'ext': 'mp4',