]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/onefootball.py
1 from .common
import InfoExtractor
4 class OneFootballIE(InfoExtractor
):
5 _VALID_URL
= r
'https?://(?:www\.)?onefootball\.com/[a-z]{2}/video/[^/&?#]+-(?P<id>\d+)'
8 'url': 'https://onefootball.com/en/video/highlights-fc-zuerich-3-3-fc-basel-34012334',
12 'title': 'Highlights: FC Zürich 3-3 FC Basel',
13 'description': 'md5:33d9855cb790702c4fe42a513700aba8',
14 'thumbnail': 'https://photobooth-api.onefootball.com/api/screenshot/https:%2F%2Fperegrine-api.onefootball.com%2Fv2%2Fphotobooth%2Fcms%2Fen%2F34012334',
15 'timestamp': 1635874604,
16 'upload_date': '20211102'
18 'params': {'skip_download': True}
20 'url': 'https://onefootball.com/en/video/klopp-fumes-at-var-decisions-in-west-ham-defeat-34041020',
24 'title': 'Klopp fumes at VAR decisions in West Ham defeat',
25 'description': 'md5:9c50371095a01ad3f63311c73d8f51a5',
26 'thumbnail': 'https://photobooth-api.onefootball.com/api/screenshot/https:%2F%2Fperegrine-api.onefootball.com%2Fv2%2Fphotobooth%2Fcms%2Fen%2F34041020',
27 'timestamp': 1636314103,
28 'upload_date': '20211107'
30 'params': {'skip_download': True}
33 def _real_extract(self
, url
):
34 id = self
._match
_id
(url
)
35 webpage
= self
._download
_webpage
(url
, id)
36 data_json
= self
._search
_json
_ld
(webpage
, id)
37 m3u8_url
= self
._html
_search
_regex
(r
'(https://cdn\.jwplayer\.com/manifests/.+\.m3u8)', webpage
, 'm3u8_url')
38 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(m3u8_url
, id)
41 'title': data_json
.get('title'),
42 'description': data_json
.get('description'),
43 'thumbnail': data_json
.get('thumbnail'),
44 'timestamp': data_json
.get('timestamp'),
46 'subtitles': subtitles
,