1 from .common
import InfoExtractor
8 from ..utils
.traversal
import traverse_obj
11 class MaarivIE(InfoExtractor
):
12 IE_NAME
= 'maariv.co.il'
13 _VALID_URL
= r
'https?://player\.maariv\.co\.il/public/player\.html\?(?:[^#]+&)?media=(?P<id>\d+)'
14 _EMBED_REGEX
= [rf
'<iframe[^>]+\bsrc=[\'"](?P<url>{_VALID_URL})']
16 'url': 'https://player.maariv.co.il/public/player.html?player=maariv-desktop&media=3611585',
21 'upload_date': '20231009',
22 'title': 'מבצע חרבות ברזל',
23 'timestamp': 1696851301,
27 'url': 'https://www.maariv.co.il/news/law/Article-1044008',
32 'upload_date': '20231009',
33 'title': 'מבצע חרבות ברזל',
34 'timestamp': 1696851301,
38 def _real_extract(self
, url
):
39 video_id
= self
._match
_id
(url
)
40 data
= self
._download
_json
(
41 f
'https://dal.walla.co.il/media/{video_id}?origin=player.maariv.co.il', video_id
)['data']
44 if hls_url
:= traverse_obj(data
, ('video', 'url', {url_or_none}
)):
45 formats
.extend(self
._extract
_m
3u8_formats
(hls_url
, video_id
, m3u8_id
='hls', fatal
=False))
47 for http_format
in traverse_obj(data
, ('video', 'stream_urls', ..., 'stream_url', {url_or_none}
)):
51 **parse_resolution(http_format
),
56 **traverse_obj(data
, {
58 'duration': ('video', 'duration', {int_or_none}
),
59 'timestamp': ('upload_date', {unified_timestamp}
),