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

Code before:
        return {
            'id': video_id,
            'formats': formats,
            'subtitles': subtitles,
            **traverse_obj(data, {
                'title': ('heading', {str}),
                'alt_title': ('subHeading', {str}),
                'description': (('lead', 'body'), {clean_html}, filter),
                'timestamp': ('created', {int_or_none}),
                'modified_timestamp': ('updated', {int_or_none}),
                'release_timestamp': (('scheduleStart', 'publicStart'), {int_or_none}),
                'release_year': ('year', {int_or_none}),
            }, get_all=False),
            **(traverse_obj(data, {
                'series': ('heading', {str}),
                'series_id': ('rootContentId', {str_or_none}),
                'episode': ('subHeading', {str}),
                'season_number': ('season', {int_or_none}),
                'episode_number': ('episode', {int_or_none}),
                'episode_id': ('id', {str_or_none}),
            }) if data.get('type') == 'episode' else {}),
        }


class ERRArhiivIE(InfoExtractor):
    _VALID_URL = r'https://arhiiv\.err\.ee/video/(?:vaata/)?(?P<id>[^/]+)$'
    _TESTS = [{
        'url': 'https://arhiiv.err.ee/video/kontsertpalad',
        'info_dict': {
            'id': 'kontsertpalad',
            'ext': 'mp4',
            'title': 'Kontsertpalad: 255 | L. Beethoveni sonaat c-moll, "Pateetiline"',
            'description': 'md5:a70f4ff23c3618f3be63f704bccef063',
            'series': 'Kontsertpalad',
            'episode_id': 255,
            'release_timestamp': 1666152162,
            'release_date': '20221019',
            'release_year': 1970,
            'modified_timestamp': 1718620982,
            'modified_date': '20240617',
        },
        'params': {'skip_download': 'm3u8'},
    }, {
        'url': 'https://arhiiv.err.ee/video/vaata/koalitsioonileppe-allkirjastamine',
        'info_dict': {
            'id': 'koalitsioonileppe-allkirjastamine',
            'ext': 'mp4',
            'title': 'Koalitsioonileppe allkirjastamine',
            'description': '',
            'series': '',
            'timestamp': 1611532800,

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https://arhiiv\.err\.ee/video/(?:vaata/)?(?P<id>[^/?#]+)'
```

Code after:
        return {
            'id': video_id,
            'formats': formats,
            'subtitles': subtitles,
            **traverse_obj(data, {
                'title': ('heading', {str}),
                'alt_title': ('subHeading', {str}),
                'description': (('lead', 'body'), {clean_html}, filter),
                'timestamp': ('created', {int_or_none}),
                'modified_timestamp': ('updated', {int_or_none}),
                'release_timestamp': (('scheduleStart', 'publicStart'), {int_or_none}),
                'release_year': ('year', {int_or_none}),
            }, get_all=False),
            **(traverse_obj(data, {
                'series': ('heading', {str}),
                'series_id': ('rootContentId', {str_or_none}),
                'episode': ('subHeading', {str}),
                'season_number': ('season', {int_or_none}),
                'episode_number': ('episode', {int_or_none}),
                'episode_id': ('id', {str_or_none}),
            }) if data.get('type') == 'episode' else {}),
        }


class ERRArhiivIE(InfoExtractor):
    _VALID_URL = r'https://arhiiv\.err\.ee/video/(?:vaata/)?(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://arhiiv.err.ee/video/kontsertpalad',
        'info_dict': {
            'id': 'kontsertpalad',
            'ext': 'mp4',
            'title': 'Kontsertpalad: 255 | L. Beethoveni sonaat c-moll, "Pateetiline"',
            'description': 'md5:a70f4ff23c3618f3be63f704bccef063',
            'series': 'Kontsertpalad',
            'episode_id': 255,
            'timestamp': 1666152162,
            'upload_date': '20221019',
            'release_year': 1970,
            'modified_timestamp': 1718620982,
            'modified_date': '20240617',
        },
        'params': {'skip_download': 'm3u8'},
    }, {
        'url': 'https://arhiiv.err.ee/video/vaata/koalitsioonileppe-allkirjastamine',
        'info_dict': {
            'id': 'koalitsioonileppe-allkirjastamine',
            'ext': 'mp4',
            'title': 'Koalitsioonileppe allkirjastamine',
            'timestamp': 1710728222,
            'upload_date': '20240318',
            'release_timestamp': 1611532800,