1 from .common
import InfoExtractor
9 from ..utils
.traversal
import traverse_obj
12 class AmadeusTVIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www\.)?amadeus\.tv/library/(?P<id>[\da-f]+)'
15 'url': 'http://www.amadeus.tv/library/65091a87ff85af59d9fc54c3',
17 'id': '5576678021301411311',
19 'title': 'Jieon Park - 第五届珠海莫扎特国际青少年音乐周小提琴C组第三轮',
20 'thumbnail': 'http://1253584441.vod2.myqcloud.com/a0046a27vodtransbj1253584441/7db4af535576678021301411311/coverBySnapshot_10_0.jpg',
22 'upload_date': '20230918',
23 'timestamp': 1695034800,
24 'display_id': '65091a87ff85af59d9fc54c3',
26 'description': 'md5:a0357b9c215489e2067cbae0b777bb95',
30 def _real_extract(self
, url
):
31 display_id
= self
._match
_id
(url
)
32 webpage
= self
._download
_webpage
(url
, display_id
)
34 nuxt_data
= self
._search
_nuxt
_data
(webpage
, display_id
, traverse
=('fetch', '0'))
35 video_id
= traverse_obj(nuxt_data
, ('item', 'video', {str}
))
38 raise ExtractorError('Unable to extract actual video ID')
40 video_data
= self
._download
_json
(
41 f
'http://playvideo.qcloud.com/getplayinfo/v2/1253584441/{video_id}',
42 video_id
, headers
={'Referer': 'http://www.amadeus.tv/'}
)
45 for video
in traverse_obj(video_data
, ('videoInfo', ('sourceVideo', ('transcodeList', ...)), {dict}
)):
46 if not url_or_none(video
.get('url')):
49 **traverse_obj(video
, {
51 'format_id': ('definition', {lambda x: f'http-{x or "0"}
'}),
52 'width
': ('width
', {int_or_none}),
53 'height
': ('height
', {int_or_none}),
54 'filesize
': (('totalSize
', 'size
'), {int_or_none}),
55 'vcodec
': ('videoStreamList
', 0, 'codec
'),
56 'acodec
': ('audioStreamList
', 0, 'codec
'),
57 'fps
': ('videoStreamList
', 0, 'fps
', {float_or_none}),
59 'http_headers
': {'Referer': 'http://www.amadeus.tv/'},
64 'display_id
': display_id,
66 **traverse_obj(video_data, {
67 'title
': ('videoInfo
', 'basicInfo
', 'name
', {str}),
68 'thumbnail
': ('coverInfo
', 'coverUrl
', {url_or_none}),
69 'duration
': ('videoInfo
', 'sourceVideo
', ('floatDuration
', 'duration
'), {float_or_none}),
71 **traverse_obj(nuxt_data, ('item
', {
72 'title
': (('title
', 'title_en
', 'title_cn
'), {str}),
73 'description
': (('description
', 'description_en
', 'description_cn
'), {str}),
74 'timestamp
': ('date
', {parse_iso8601}),
75 'view_count
': ('view
', {int_or_none}),