]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/veo.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
14 class VeoIE(InfoExtractor
):
15 _VALID_URL
= r
'https?://app\.veo\.co/matches/(?P<id>[0-9A-Za-z-]+)'
18 'url': 'https://app.veo.co/matches/20201027-last-period/',
20 'id': '20201027-last-period',
22 'title': 'Akidemy u11s v Bradford Boys u11s (Game 3)',
23 'thumbnail': 're:https://c.veocdn.com/.+/thumbnail.jpg',
24 'upload_date': '20201028',
25 'timestamp': 1603847208,
30 def _real_extract(self
, url
):
31 video_id
= self
._match
_id
(url
)
33 metadata
= self
._download
_json
(
34 'https://app.veo.co/api/app/matches/%s' % video_id
, video_id
)
36 video_data
= self
._download
_json
(
37 'https://app.veo.co/api/app/matches/%s/videos' % video_id
, video_id
, 'Downloading video data')
39 title
= metadata
.get('title')
40 thumbnail
= url_or_none(metadata
.get('thumbnail'))
42 timestamp
= unified_timestamp(metadata
.get('created'))
43 duration
= int_or_none(metadata
.get('duration'))
44 view_count
= int_or_none(metadata
.get('view_count'))
47 for fmt
in video_data
:
48 mimetype
= fmt
.get('mime_type')
49 # skip configuration file for panoramic video
50 if mimetype
== 'video/mp2t':
52 height
= int_or_none(fmt
.get('height'))
53 bitrate
= int_or_none(fmt
.get('bit_rate'), scale
=1000)
54 render_type
= fmt
.get('render_type')
56 'url': url_or_none(fmt
.get('url')),
57 'format_id': '%s-%sp' % (render_type
, height
),
58 'ext': mimetype2ext(mimetype
),
59 'width': int_or_none(fmt
.get('width')),
64 self
._sort
_formats
(formats
)
70 'thumbnail': thumbnail
,
71 'timestamp': timestamp
,
72 'view_count': view_count
,