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

Code before:
        },
        'params': {'skip_download': 'm3u8'},
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        data = self._download_json(
            f'https://arhiiv.err.ee/api/v1/content/video/{video_id}', video_id)

        formats, subtitles = [], {}
        if hls_url := traverse_obj(data, ('media', 'src', 'hls', {url_or_none})):
            fmts, subs = self._extract_m3u8_formats_and_subtitles(
                hls_url, video_id, 'mp4', m3u8_id='hls', fatal=False)
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)
        if dash_url := traverse_obj(data, ('media', 'src', 'dash', {url_or_none})):
            fmts, subs = self._extract_mpd_formats_and_subtitles(
                dash_url, video_id, mpd_id='dash', fatal=False)
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)

        return {
            'id': video_id,
            'formats': formats,
            'subtitles': subtitles,
            **traverse_obj(data['info'], {
                'title': ('title', {str}),
                'series': ('seriesTitle', {str}, filter),
                'series_id': ('seriesId', {str}, filter),
                'episode_id': ('episode', {int_or_none}),
                'description': ('synopsis', {str}, filter),
                'timestamp': ('uploadDate', {parse_iso8601}),
                'modified_timestamp': ('dateModified', {parse_iso8601}),
                'release_timestamp': ('date', {parse_iso8601}),
                'release_year': ('year', {int_or_none}),
            }, get_all=False),
        }


Review comment (refactor):
We can make the metadata extraction non-fatal
```suggestion
            **traverse_obj(data, ('info', {
```

Code after:
        },
        'params': {'skip_download': 'm3u8'},
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        data = self._download_json(
            f'https://arhiiv.err.ee/api/v1/content/video/{video_id}', video_id)

        formats, subtitles = [], {}
        if hls_url := traverse_obj(data, ('media', 'src', 'hls', {url_or_none})):
            fmts, subs = self._extract_m3u8_formats_and_subtitles(
                hls_url, video_id, 'mp4', m3u8_id='hls', fatal=False)
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)
        if dash_url := traverse_obj(data, ('media', 'src', 'dash', {url_or_none})):
            fmts, subs = self._extract_mpd_formats_and_subtitles(
                dash_url, video_id, mpd_id='dash', fatal=False)
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)

        return {
            'id': video_id,
            'formats': formats,
            'subtitles': subtitles,
            **traverse_obj(data, ('info', {
                'title': ('title', {str}),
                'series': ('seriesTitle', {str}, filter),
                'series_id': ('seriesId', {str}, filter),
                'episode_id': ('episode', {int_or_none}),
                'description': ('synopsis', {str}, filter),
                'timestamp': ('uploadDate', {parse_iso8601}),
                'modified_timestamp': ('dateModified', {parse_iso8601}),
                'release_timestamp': ('date', {parse_iso8601}),
                'release_year': ('year', {int_or_none}),
            })),
        }