1 from .common
import InfoExtractor
10 class FifaIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://www.fifa.com/fifaplus/(?P<locale>\w{2})/watch/([^#?]+/)?(?P<id>\w+)'
13 'url': 'https://www.fifa.com/fifaplus/en/watch/7on10qPcnyLajDDU3ntg6y',
15 'id': '7on10qPcnyLajDDU3ntg6y',
16 'title': 'Italy v France | Final | 2006 FIFA World Cup Germany™ | Full Match Replay',
17 'description': 'md5:f4520d0ee80529c8ba4134a7d692ff8b',
19 'categories': ['FIFA Tournaments'],
20 'thumbnail': 'https://digitalhub.fifa.com/transform/fa6f0b3e-a2e9-4cf7-9f32-53c57bcb7360/2006_Final_ITA_FRA',
23 'params': {'skip_download': 'm3u8'}
,
25 'url': 'https://www.fifa.com/fifaplus/pt/watch/1cg5r5Qt6Qt12ilkDgb1sV',
27 'id': '1cg5r5Qt6Qt12ilkDgb1sV',
28 'title': 'Brazil v Germany | Semi-finals | 2014 FIFA World Cup Brazil™ | Extended Highlights',
29 'description': 'md5:d908c74ee66322b804ae2e521b02a855',
31 'categories': ['FIFA Tournaments', 'Highlights'],
32 'thumbnail': 'https://digitalhub.fifa.com/transform/d8fe6f61-276d-4a73-a7fe-6878a35fd082/FIFAPLS_100EXTHL_2014BRAvGER_TMB',
34 'release_timestamp': 1404777600,
35 'release_date': '20140708',
37 'params': {'skip_download': 'm3u8'}
,
39 'url': 'https://www.fifa.com/fifaplus/fr/watch/3C6gQH9C2DLwzNx7BMRQdp',
41 'id': '3C6gQH9C2DLwzNx7BMRQdp',
42 'title': 'Josimar goal against Northern Ireland | Classic Goals',
43 'description': 'md5:cbe7e7bb52f603c9f1fe9a4780fe983b',
45 'categories': ['FIFA Tournaments', 'Goal'],
47 'thumbnail': 'https://digitalhub.fifa.com/transform/f9301391-f8d9-48b5-823e-c093ac5e3e11/CG_MEN_1986_JOSIMAR',
49 'params': {'skip_download': 'm3u8'}
,
52 def _real_extract(self
, url
):
53 video_id
, locale
= self
._match
_valid
_url
(url
).group('id', 'locale')
54 webpage
= self
._download
_webpage
(url
, video_id
)
56 preconnect_link
= self
._search
_regex
(
57 r
'<link[^>]+rel\s*=\s*"preconnect"[^>]+href\s*=\s*"([^"]+)"', webpage
, 'Preconnect Link')
59 video_details
= self
._download
_json
(
60 f
'{preconnect_link}/sections/videoDetails/{video_id}', video_id
, 'Downloading Video Details', fatal
=False)
62 preplay_parameters
= self
._download
_json
(
63 f
'{preconnect_link}/video/GetVerizonPreplayParameters/{video_id}', video_id
, 'Downloading Preplay Parameters')['preplayParameters']
65 cid
= preplay_parameters
['contentId']
66 content_data
= self
._download
_json
(
67 f
'https://content.uplynk.com/preplay/{cid}/multiple.json', video_id
, 'Downloading Content Data', query
={
68 'v': preplay_parameters
['preplayAPIVersion'],
69 'tc': preplay_parameters
['tokenCheckAlgorithmVersion'],
70 'rn': preplay_parameters
['randomNumber'],
71 'exp': preplay_parameters
['tokenExpirationDate'],
72 'ct': preplay_parameters
['contentType'],
74 'mbtracks': preplay_parameters
['tracksAssetNumber'],
75 'ad': preplay_parameters
['adConfiguration'],
76 'ad.preroll': int(preplay_parameters
['adPreroll']),
77 'ad.cmsid': preplay_parameters
['adCMSSourceId'],
78 'ad.vid': preplay_parameters
['adSourceVideoID'],
79 'sig': preplay_parameters
['signature'],
82 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(content_data
['playURL'], video_id
)
83 self
._sort
_formats
(formats
)
87 'title': video_details
.get('title'),
88 'description': video_details
.get('description'),
89 'duration': int_or_none(video_details
.get('duration')),
90 'release_timestamp': unified_timestamp(video_details
.get('dateOfRelease')),
91 'categories': traverse_obj(video_details
, (('videoCategory', 'videoSubcategory'),)),
92 'thumbnail': traverse_obj(video_details
, ('backgroundImage', 'src')),
94 'subtitles': subtitles
,