1 from .common
import InfoExtractor
2 from ..utils
import url_or_none
3 from ..utils
.traversal
import traverse_obj
6 class SenIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://(?:www\.)?sen\.com/video/(?P<id>[0-9a-f-]+)'
9 'url': 'https://www.sen.com/video/eef46eb1-4d79-4e28-be9d-bd937767f8c4',
10 'md5': 'ff615aca9691053c94f8f10d96cd7884',
12 'id': 'eef46eb1-4d79-4e28-be9d-bd937767f8c4',
14 'description': 'Florida, 28 Sep 2022',
15 'title': 'Hurricane Ian',
16 'tags': ['North America', 'Storm', 'Weather'],
20 def _real_extract(self
, url
):
21 video_id
= self
._match
_id
(url
)
23 api_data
= self
._download
_json
(f
'https://api.sen.com/content/public/video/{video_id}', video_id
)
24 m3u8_url
= (traverse_obj(api_data
, (
25 'data', 'nodes', lambda _
, v
: v
['id'] == 'player', 'video', 'url', {url_or_none}
, any
))
26 or f
'https://vod.sen.com/videos/{video_id}/manifest.m3u8')
30 'formats': self
._extract
_m
3u8_formats
(m3u8_url
, video_id
, 'mp4'),
31 **traverse_obj(api_data
, ('data', 'nodes', lambda _
, v
: v
['id'] == 'details', any
, 'content', {
32 'title': ('title', 'text', {str}
),
33 'description': ('descriptions', 0, 'text', {str}
),
34 'tags': ('badges', ..., 'text', {str}
),