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

Code before:
                {
                    'format_id': '0',
                    'url': main_video_to_download_url,
                    'resolution': 'Main Video',
                }
            ]

            for format_id, stream_url_object in enumerate(data['video']['stream_urls'], start=1):
                stream_url = stream_url_object['stream_url']
                resolution = self.extract_resolution(stream_url)
                format_info = {
                    'format_id': str(format_id),
                    'url': stream_url,
                    'resolution': resolution,
                }
                format_list.append(format_info)

            video_info = {
                'id': media_param,
                'title': main_video_to_download_filename,
                'thumbnail': thumbnail,
                'duration': duration_seconds,
                'formats': format_list,
            }

            video_info_list.append(video_info)

        if len(video_info_list) == 1:
            return video_info_list[0]
        else:
            # If there are multiple videos, create a playlist
            return self.playlist_result(video_info_list, video_id)


Review comment (suggestion):
this should be inline as well
```suggestion
            video_info_list.append({
                'id': media_param,
                'title': main_video_to_download_filename,
                'thumbnail': thumbnail,
                'duration': duration_seconds,
                'formats': format_list,
            })
```

also, i don't speak hebrew so i don't know if it's correct, but `data['title']` looks like it has an actual title
you should use that (or whatever the actual title is), not the original filename
otherwise the file you end up downloading is called `3611585-73.mp4 [3611585].mp4` (with the default output template), rather than e.g. `the title [3611585].mp4`

we can inline even more with `traverse_obj`

```suggestion
            video_info_list.append({
                'id': media_param,
                **traverse_obj(data, {
                    'title': ('video', 'file_name'),
                    'duration': ('video', 'duration', {int_or_none}),
                    'timestamp': ('upload_date', {unified_timestamp}),
                    'modified_timestamp': ('update_date', {unified_timestamp}),
                }),
                'thumbnail': thumbnail,
                'formats': format_list,
            })
```
i added `timestamp` and `modified_timestamp` since they're easy to do

add this at the top of the file
```python3
from ..utils import (
    int_or_none,
    traverse_obj,
    unified_timestamp,
)
```

and remove `main_video_to_download_filename` and `duration_seconds` from further up since they're not needed any more

Code after:
from .common import InfoExtractor
from ..utils import (
    int_or_none,
    parse_resolution,
    unified_timestamp,
    url_or_none,
)
from ..utils.traversal import traverse_obj


class MaarivIE(InfoExtractor):
    IE_NAME = 'maariv.co.il'
    _VALID_URL = r'https?://player\.maariv\.co\.il/public/player\.html\?(?:[^#]+&)?media=(?P<id>\d+)'
    _EMBED_REGEX = [rf'<iframe[^>]+\bsrc=[\'"](?P<url>{_VALID_URL})']
    _TESTS = [{
        'url': 'https://player.maariv.co.il/public/player.html?player=maariv-desktop&media=3611585',
        'info_dict': {
            'id': '3611585',
            'duration': 75,
            'ext': 'mp4',
            'upload_date': '20231009',
            'title': 'מבצע חרבות ברזל',
            'timestamp': 1696851301,
        },
    }]
    _WEBPAGE_TESTS = [{
        'url': 'https://www.maariv.co.il/news/law/Article-1044008',
        'info_dict': {
            'id': '3611585',
            'duration': 75,
            'ext': 'mp4',
            'upload_date': '20231009',
            'title': 'מבצע חרבות ברזל',
            'timestamp': 1696851301,
        },
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        data = self._download_json(
            f'https://dal.walla.co.il/media/{video_id}?origin=player.maariv.co.il', video_id)['data']

        formats = []
        if hls_url := traverse_obj(data, ('video', 'url', {url_or_none})):
            formats.extend(self._extract_m3u8_formats(hls_url, video_id, m3u8_id='hls', fatal=False))

        for http_format in traverse_obj(data, ('video', 'stream_urls', ..., 'stream_url', {url_or_none})):
            formats.append({
                'url': http_format,
                'format_id': 'http',
                **parse_resolution(http_format),
            })

        return {
            'id': video_id,
            **traverse_obj(data, {
                'title': 'title',
                'duration': ('video', 'duration', {int_or_none}),
                'timestamp': ('upload_date', {unified_timestamp}),
            }),
            'formats': formats,
        }