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',
30 'thumbnail': 'https://images.dotstudiopro.com/5f4e9d330a0c3b295a7e8394',
33 'url': 'https://www.axs.tv/channel/rock-star-interview/video/daryl-hall',
34 'md5': '300ae795cd8f9984652c0949734ffbdc',
36 'id': '5f488148b70e4f392572977c',
37 'display_id': 'daryl-hall',
38 'title': 'Daryl Hall',
40 'description': 'md5:e54ecaa0f4b5683fc9259e9e4b196628',
41 'upload_date': '20230214',
42 'timestamp': 1676403615,
44 'series': 'The Big Interview with Dan Rather',
48 'thumbnail': 'https://images.dotstudiopro.com/5f4d1901f340b50d937cec32',
52 def _real_extract(self
, url
):
53 display_id
= self
._match
_id
(url
)
54 webpage
= self
._download
_webpage
(url
, display_id
)
56 webpage_json_data
= self
._search
_json
(
57 r
'mountObj\s*=', webpage
, 'video ID data', display_id
,
58 transform_source
=js_to_json
)
59 video_id
= webpage_json_data
['video_id']
60 company_id
= webpage_json_data
['company_id']
62 meta
= self
._download
_json
(
63 f
'https://api.myspotlight.tv/dotplayer/video/{company_id}/{video_id}',
64 video_id
, query
={'device_type': 'desktop_web'})['video']
66 formats
= self
._extract
_m
3u8_formats
(
67 meta
['video_m3u8'], video_id
, 'mp4', m3u8_id
='hls')
70 for cc
in traverse_obj(meta
, ('closeCaption', lambda _
, v
: url_or_none(v
['srtPath']))):
71 subtitles
.setdefault(cc
.get('srtShortLang') or 'en', []).append(
72 {'ext': cc
.get('srtExt'), 'url': cc
['srtPath']})
76 'display_id': display_id
,
78 **traverse_obj(meta
, {
79 'title': ('title', {str}
),
80 'description': ('description', {str}
),
81 'series': ('seriestitle', {str}
),
82 'season_number': ('season', {int}
),
83 'episode': ('episode', {str}
),
84 'duration': ('duration', {float_or_none}
),
85 'timestamp': ('updated_at', {parse_iso8601}
),
86 'thumbnail': ('thumb', {url_or_none}
),
88 'subtitles': subtitles
,