1 from .common
import InfoExtractor
9 class FifaIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://www\.fifa\.com/fifaplus/(?P<locale>\w{2})/watch/([^#?]+/)?(?P<id>\w+)'
12 'url': 'https://www.fifa.com/fifaplus/en/watch/7on10qPcnyLajDDU3ntg6y',
14 'id': '7on10qPcnyLajDDU3ntg6y',
15 'title': 'Italy v France | Final | 2006 FIFA World Cup Germany™ | Full Match Replay',
16 'description': 'md5:f4520d0ee80529c8ba4134a7d692ff8b',
18 'categories': ['FIFA Tournaments'],
19 'thumbnail': 'https://digitalhub.fifa.com/transform/135e2656-3a51-407b-8810-6c34bec5b59b/FMR_2006_Italy_France_Final_Hero',
21 'release_timestamp': 1152403200,
22 'release_date': '20060709',
24 'params': {'skip_download': 'm3u8'},
26 'url': 'https://www.fifa.com/fifaplus/pt/watch/1cg5r5Qt6Qt12ilkDgb1sV',
28 'id': '1cg5r5Qt6Qt12ilkDgb1sV',
29 'title': 'Brazil v Germany | Semi-finals | 2014 FIFA World Cup Brazil™ | Extended Highlights',
30 'description': 'md5:d908c74ee66322b804ae2e521b02a855',
32 'categories': ['FIFA Tournaments', 'Highlights'],
33 'thumbnail': 'https://digitalhub.fifa.com/transform/d8fe6f61-276d-4a73-a7fe-6878a35fd082/FIFAPLS_100EXTHL_2014BRAvGER_TMB',
35 'release_timestamp': 1404777600,
36 'release_date': '20140708',
38 'params': {'skip_download': 'm3u8'},
40 'url': 'https://www.fifa.com/fifaplus/fr/watch/3C6gQH9C2DLwzNx7BMRQdp',
42 'id': '3C6gQH9C2DLwzNx7BMRQdp',
43 'title': 'Josimar goal against Northern Ireland | Classic Goals',
44 'description': 'md5:cbe7e7bb52f603c9f1fe9a4780fe983b',
46 'categories': ['FIFA Tournaments', 'Goal'],
48 'thumbnail': 'https://digitalhub.fifa.com/transform/f9301391-f8d9-48b5-823e-c093ac5e3e11/CG_MEN_1986_JOSIMAR',
50 'params': {'skip_download': 'm3u8'},
53 def _real_extract(self
, url
):
54 video_id
, locale
= self
._match
_valid
_url
(url
).group('id', 'locale')
55 webpage
= self
._download
_webpage
(url
, video_id
)
57 preconnect_link
= self
._search
_regex
(
58 r
'<link\b[^>]+\brel\s*=\s*"preconnect"[^>]+href\s*=\s*"([^"]+)"', webpage
, 'Preconnect Link')
60 video_details
= self
._download
_json
(
61 f
'{preconnect_link}/sections/videoDetails/{video_id}', video_id
, 'Downloading Video Details', fatal
=False)
63 preplay_parameters
= self
._download
_json
(
64 f
'{preconnect_link}/videoPlayerData/{video_id}', video_id
, 'Downloading Preplay Parameters')['preplayParameters']
66 content_data
= self
._download
_json
(
67 'https://content.uplynk.com/preplay/{contentId}/multiple.json?{queryStr}&sig={signature}'.format(**preplay_parameters
),
68 video_id
, 'Downloading Content Data')
70 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(content_data
['playURL'], video_id
)
74 'title': video_details
.get('title'),
75 'description': video_details
.get('description'),
76 'duration': int_or_none(video_details
.get('duration')),
77 'release_timestamp': unified_timestamp(video_details
.get('dateOfRelease')),
78 'categories': traverse_obj(video_details
, (('videoCategory', 'videoSubcategory'),)),
79 'thumbnail': traverse_obj(video_details
, ('backgroundImage', 'src')),
81 'subtitles': subtitles
,