1 from .common
import InfoExtractor
2 from ..utils
import bool_or_none
, traverse_obj
, unified_timestamp
, url_or_none
5 class EttuTvIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(?:www\.)?ettu\.tv/[^?#]+/playerpage/(?P<id>[0-9]+)'
9 'url': 'https://www.ettu.tv/en-int/playerpage/1573849',
10 'md5': '5874b7639a2aa866d1f6c3a4037c7c09',
13 'title': 'Ni Xia Lian - Shao Jieni',
14 'description': 'ITTF Europe Top 16 Cup',
15 'timestamp': 1677348600,
16 'upload_date': '20230225',
17 'thumbnail': r
're:^https?://.*\.(?:jpg|png)',
21 'url': 'https://www.ettu.tv/en-int/playerpage/1573753',
22 'md5': '1fc094bf96cf2d5ec0f434d3a6dec9aa',
25 'title': 'Qiu Dang - Jorgic Darko',
26 'description': 'ITTF Europe Top 16 Cup',
27 'timestamp': 1677423600,
28 'upload_date': '20230226',
29 'thumbnail': r
're:^https?://.*\.(?:jpg|png)',
34 def _real_extract(self
, url
):
35 video_id
= self
._match
_id
(url
)
37 player_settings
= self
._download
_json
(
38 f
'https://www.ettu.tv/api/v3/contents/{video_id}/player-settings', video_id
, query
={
44 stream_response
= self
._download
_json
(player_settings
['streamAccess'], video_id
, data
=b
'')
46 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(
47 stream_response
['data']['stream'], video_id
, 'mp4')
52 'subtitles': subtitles
,
53 **traverse_obj(player_settings
, {
55 'description': ('metaInformation', 'competition'),
56 'thumbnail': ('image', {url_or_none}
),
57 'timestamp': ('date', {unified_timestamp}
),
58 'is_live': ('isLivestream', {bool_or_none}
),