1 from .common
import InfoExtractor
11 class AxsIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www\.)?axs\.tv/(?:channel/(?:[^/?#]+/)+)?video/(?P<id>[^/?#]+)'
16 'url': 'https://www.axs.tv/video/5f4dc776b70e4f1c194f22ef/',
17 'md5': '8d97736ae8e50c64df528e5e676778cf',
19 'id': '5f4dc776b70e4f1c194f22ef',
20 'title': 'Small Town',
22 'description': 'md5:e314d28bfaa227a4d7ec965fae19997f',
23 'upload_date': '20230602',
24 'timestamp': 1685729564,
26 'series': 'Rock & Roll Road Trip with Sammy Hagar',
29 'thumbnail': 'https://images.dotstudiopro.com/5f4e9d330a0c3b295a7e8394',
32 'url': 'https://www.axs.tv/channel/rock-star-interview/video/daryl-hall',
33 'md5': '300ae795cd8f9984652c0949734ffbdc',
35 'id': '5f488148b70e4f392572977c',
36 'display_id': 'daryl-hall',
37 'title': 'Daryl Hall',
39 'description': 'md5:e54ecaa0f4b5683fc9259e9e4b196628',
40 'upload_date': '20230214',
41 'timestamp': 1676403615,
43 'series': 'The Big Interview with Dan Rather',
46 'thumbnail': 'https://images.dotstudiopro.com/5f4d1901f340b50d937cec32',
50 def _real_extract(self
, url
):
51 display_id
= self
._match
_id
(url
)
52 webpage
= self
._download
_webpage
(url
, display_id
)
54 webpage_json_data
= self
._search
_json
(
55 r
'mountObj\s*=', webpage
, 'video ID data', display_id
,
56 transform_source
=js_to_json
)
57 video_id
= webpage_json_data
['video_id']
58 company_id
= webpage_json_data
['company_id']
60 meta
= self
._download
_json
(
61 f
'https://api.myspotlight.tv/dotplayer/video/{company_id}/{video_id}',
62 video_id
, query
={'device_type': 'desktop_web'}
)['video']
64 formats
= self
._extract
_m
3u8_formats
(
65 meta
['video_m3u8'], video_id
, 'mp4', m3u8_id
='hls')
68 for cc
in traverse_obj(meta
, ('closeCaption', lambda _
, v
: url_or_none(v
['srtPath']))):
69 subtitles
.setdefault(cc
.get('srtShortLang') or 'en', []).append(
70 {'ext': cc.get('srtExt'), 'url': cc['srtPath']}
)
74 'display_id': display_id
,
76 **traverse_obj(meta
, {
77 'title': ('title', {str}
),
78 'description': ('description', {str}
),
79 'series': ('seriestitle', {str}
),
80 'season': ('season', {int}
),
81 'episode': ('episode', {str}
),
82 'duration': ('duration', {float_or_none}
),
83 'timestamp': ('updated_at', {parse_iso8601}
),
84 'thumbnail': ('thumb', {url_or_none}
),
86 'subtitles': subtitles
,