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

Code before:
        video_id = join_nonempty(telecast_id, episode, delim='_')
        webpage = self._download_webpage(url, video_id)
        video_player = try_call(lambda: extract_attributes(
            get_element_text_and_html_by_tag('video-player', webpage)[1]))
        if not video_player or not video_player.get('manifest-url'):
            self.raise_no_formats('No video found', expected=True)

        episode_attr = self._parse_json(video_player.get(':episode') or '', video_id, fatal=False) or {}

        return {
            'id': video_id,
            'title': episode_attr.get('title') if episode_attr.get('category') == 'movies' else (
                traverse_obj(episode_attr, 'subtitle', ('episode_nr', {lambda x: f'Episode {x}' if x else None}), 'title')),
            'formats': self._extract_m3u8_formats(video_player['manifest-url'], video_id, 'mp4'),
            **traverse_obj(episode_attr, {
                'description': 'synopsis',
                'thumbnail': ('images', 'original'),
                'timestamp': ('airtime', {lambda x: unified_timestamp(x + ' +0200')}),
                'series': 'title',
                'series_id': ('telecast_id', {str_or_none}),
                'season_number': ('season_id', {int_or_none}),
                'episode': 'subtitle',
                'episode_number': ('episode_nr', {int_or_none}),
                'episode_id': ('episode_id', {int_or_none}),
                'cast': ('cast', {lambda x: x.split(', ')}),
            }),
        }


Review comment (refactor):
No longer include series related data in movies:
```suggestion
            'id': video_id,
            'formats': self._extract_m3u8_formats(video_player['manifest-url'], video_id, 'mp4'),
            **traverse_obj(episode_attr, {
                'title': 'title',
                'description': 'synopsis',
                'thumbnail': ('images', 'original'),
                'timestamp': ('airtime', {lambda x: unified_timestamp(x + ' +0200')}),
                'cast': ('cast', {lambda x: x.split(', ')}),
                'release_year': ('year', {int_or_none}),
            }),
            **(traverse_obj(episode_attr, {
                'title': (None, ('subtitle', ('episode_nr', {lambda x: f'Episode {x}' if x else None}))),
                'series': 'title',
                'series_id': ('telecast_id', {str_or_none}),
                'season_number': ('season_id', {int_or_none}),
                'episode': 'subtitle',
                'episode_number': ('episode_nr', {int_or_none}),
                'episode_id': ('episode_id', {int_or_none}),
            }, get_all=False) if episode_attr.get('category') != 'movies' else {}),
```
Also added release_year

Code after:
            'cast': 'count:9',
            'upload_date': '20221214',
            'timestamp': 1671054000,
            'release_year': 2018,
        },
    }]

    def _real_extract(self, url):
        telecast_id, episode = self._match_valid_url(url).group('id', 'ep')
        video_id = join_nonempty(telecast_id, episode, delim='_')
        webpage = self._download_webpage(url, video_id)
        video_player = try_call(lambda: extract_attributes(
            get_element_text_and_html_by_tag('video-player', webpage)[1]))
        if not video_player or not video_player.get('manifest-url'):
            raise ExtractorError('No video found', expected=True)

        episode_attr = self._parse_json(video_player.get(':episode') or '', video_id, fatal=False) or {}

        return {
            'id': video_id,
            'formats': self._extract_m3u8_formats(video_player['manifest-url'], video_id, 'mp4'),
            **traverse_obj(episode_attr, {
                'title': 'title',
                'description': 'synopsis',
                'thumbnail': ('images', 'original'),
                'timestamp': ('airtime', {lambda x: unified_timestamp(x + ' +0200')}),
                'cast': ('cast', {lambda x: x.split(', ')}),
                'release_year': ('year', {int_or_none}),
            }),
            **(traverse_obj(episode_attr, {
                'title': (None, ('subtitle', ('episode_nr', {lambda x: f'Episode {x}' if x else None}))),
                'series': 'title',
                'series_id': ('telecast_id', {str_or_none}),
                'season_number': ('season_id', {int_or_none}),
                'episode': 'subtitle',
                'episode_number': ('episode_nr', {int_or_none}),
                'episode_id': ('episode_id', {int_or_none}),
            }, get_all=False) if episode_attr.get('category') != 'movies' else {}),
        }