1 from .common
import InfoExtractor
11 class VeoIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://app\.veo\.co/matches/(?P<id>[0-9A-Za-z-_]+)'
15 'url': 'https://app.veo.co/matches/20201027-last-period/',
17 'id': '20201027-last-period',
19 'title': 'Akidemy u11s v Bradford Boys u11s (Game 3)',
20 'thumbnail': 're:https://c.veocdn.com/.+/thumbnail.jpg',
21 'upload_date': '20201028',
22 'timestamp': 1603847208,
27 'url': 'https://app.veo.co/matches/20220313-2022-03-13_u15m-plsjq-vs-csl/',
28 'only_matching': True,
31 def _real_extract(self
, url
):
32 video_id
= self
._match
_id
(url
)
34 metadata
= self
._download
_json
(
35 f
'https://app.veo.co/api/app/matches/{video_id}', video_id
)
37 video_data
= self
._download
_json
(
38 f
'https://app.veo.co/api/app/matches/{video_id}/videos', video_id
, 'Downloading video data')
41 for fmt
in video_data
:
42 mimetype
= str_or_none(fmt
.get('mime_type'))
43 format_url
= url_or_none(fmt
.get('url'))
44 # skip configuration file for panoramic video
45 if not format_url
or mimetype
== 'video/mp2t':
48 height
= int_or_none(fmt
.get('height'))
49 render_type
= str_or_none(fmt
.get('render_type'))
50 format_id
= f
'{render_type}-{height}p' if render_type
and height
else None
52 # Veo returns panoramic video information even if panoramic video is not available.
53 # e.g. https://app.veo.co/matches/20201027-last-period/
54 if render_type
== 'panorama':
55 if not self
._is
_valid
_url
(format_url
, video_id
, format_id
):
60 'format_id': format_id
,
61 'ext': mimetype2ext(mimetype
),
62 'width': int_or_none(fmt
.get('width')),
64 'vbr': int_or_none(fmt
.get('bit_rate'), scale
=1000),
69 'title': str_or_none(metadata
.get('title')),
71 'thumbnail': url_or_none(metadata
.get('thumbnail')),
72 'timestamp': unified_timestamp(metadata
.get('created')),
73 'view_count': int_or_none(metadata
.get('view_count')),
74 'duration': int_or_none(metadata
.get('duration')),