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

Code before:
                'subtitles': {},
                'age_limit': 0,
                'webpage_url': 'https://areena.yle.fi/1-2158940'
            }
        }
    ]

    def generate_api_headers(
            self):
        """Prepare requested site header"""
        headers = {
            'origin': 'https://areena.yle.fi',
            'referer': 'https://areena.yle.fi/'
        }
        return filter_dict(headers)

    def _real_extract(self, url):
        video_id = self._match_id(url)
        info = self._search_json_ld(self._download_webpage(url, video_id), video_id, default={})
        # Generate headers
        real_headers = self.generate_api_headers()
        real_headers.update({'content-type': 'application/json'})

        video_data = self._download_json(
            f'https://player.api.yle.fi/v1/preview/{video_id}.json?app_id=player_static_prod&app_key=8930d72170e48303cf5f3867780d549b',
            video_id, fatal=True, headers=real_headers)

        # Example title: 'K1, J2: Pouchit | Modernit miehet'
        series, season_number, episode_number, episode = self._search_regex(
            r'K(?P<season_no>[\d]+),\s*J(?P<episode_no>[\d]+):?\s*\b(?P<episode>[^|]+)\s*|\s*(?P<series>.+)',
            info.get('title') or '', 'episode metadata', group=('season_no', 'episode_no', 'episode', 'series'),
            default=(None, None, None, None))
        description = traverse_obj(video_data, ('data', 'ongoing_ondemand', 'description', 'fin'), expected_type=str)

        subtitles = {}
        for sub in traverse_obj(video_data, ('data', 'ongoing_ondemand', 'subtitles', ...)):
            if url_or_none(sub.get('uri')):
                subtitles.setdefault(sub.get('language') or 'und', []).append({
                    'url': sub['uri'],
                    'ext': 'srt',
                    'name': sub.get('kind'),
                })

        # Video manifest URL
        manifest_url = traverse_obj(video_data, ('data', 'ongoing_ondemand', 'manifest_url'))
        # Extract video release date
        start_time = traverse_obj(video_data, ('data', 'ongoing_ondemand', 'start_time'), expected_type=str)
        release_date = '%s%s%s' % (start_time[0:4], start_time[5:7], start_time[8:10])
        # Service URL
        kaltura_url = 'kaltura:1955031:%s' % traverse_obj(video_data, ('data', 'ongoing_ondemand', 'kaltura', 'id'))
        # Include video source URL for Kaltura internal use

Review comment (suggestion):
```suggestion
            video_id, headers=real_headers)
```
it is the default

Code after:
                'uploader_id': 'ovp@yle.fi',
                'duration': 319,
                'view_count': int,
                'upload_date': '20211202',
                'release_date': '20211215',
                'timestamp': 1638448202,
                'subtitles': {},
                'age_limit': 0,
                'webpage_url': 'https://areena.yle.fi/1-2158940'
            }
        }
    ]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        info = self._search_json_ld(self._download_webpage(url, video_id), video_id, default={})
        video_data = self._download_json(
            f'https://player.api.yle.fi/v1/preview/{video_id}.json?app_id=player_static_prod&app_key=8930d72170e48303cf5f3867780d549b',
            video_id, headers={
                'origin': 'https://areena.yle.fi',
                'referer': 'https://areena.yle.fi/',
                'content-type': 'application/json'
            })

        # Example title: 'K1, J2: Pouchit | Modernit miehet'
        series, season_number, episode_number, episode = self._search_regex(
            r'K(?P<season_no>[\d]+),\s*J(?P<episode_no>[\d]+):?\s*\b(?P<episode>[^|]+)\s*|\s*(?P<series>.+)',
            info.get('title') or '', 'episode metadata', group=('season_no', 'episode_no', 'episode', 'series'),
            default=(None, None, None, None))
        description = traverse_obj(video_data, ('data', 'ongoing_ondemand', 'description', 'fin'), expected_type=str)

        subtitles = {}
        for sub in traverse_obj(video_data, ('data', 'ongoing_ondemand', 'subtitles', ...)):
            if url_or_none(sub.get('uri')):
                subtitles.setdefault(sub.get('language') or 'und', []).append({
                    'url': sub['uri'],
                    'ext': 'srt',
                    'name': sub.get('kind'),
                })

        return {
            '_type': 'url_transparent',
            'url': smuggle_url(
                f'kaltura:1955031:{video_data["data"]["ongoing_ondemand"]["kaltura"]["id"]}',
                {'source_url': url}),
            'ie_key': KalturaIE.ie_key(),
            'title': (traverse_obj(video_data, ('data', 'ongoing_ondemand', 'title', 'fin'), expected_type=str)
                      or episode or info.get('title')),
            'description': description,
            'series': (traverse_obj(video_data, ('data', 'ongoing_ondemand', 'series', 'title', 'fin'), expected_type=str)
                       or series),