3 from .common
import InfoExtractor
11 class TF1IE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?tf1\.fr/[^/]+/(?P<program_slug>[^/]+)/videos/(?P<id>[^/?&#]+)\.html'
14 'url': 'https://www.tf1.fr/tmc/quotidien-avec-yann-barthes/videos/quotidien-premiere-partie-11-juin-2019.html',
18 'title': 'md5:f392bc52245dc5ad43771650c96fb620',
19 'description': 'md5:a02cdb217141fb2d469d6216339b052f',
20 'upload_date': '20190611',
21 'timestamp': 1560273989,
23 'series': 'Quotidien avec Yann Barthès',
24 'tags': ['intégrale', 'quotidien', 'Replay'],
27 # Sometimes wat serves the whole file with the --test option
28 'skip_download': True,
31 'url': 'https://www.tf1.fr/tmc/burger-quiz/videos/burger-quiz-du-19-aout-2023-s03-episode-21-85585666.html',
35 'title': 'Burger Quiz - S03 EP21 avec Eye Haidara, Anne Depétrini, Jonathan Zaccaï et Pio Marmaï',
36 'thumbnail': 'https://photos.tf1.fr/1280/720/burger-quiz-11-9adb79-0@1x.jpg',
37 'description': 'Manu Payet recevra Eye Haidara, Anne Depétrini, Jonathan Zaccaï et Pio Marmaï.',
38 'upload_date': '20230819',
39 'timestamp': 1692469471,
41 'series': 'Burger Quiz',
45 'episode': 'Episode 21',
48 'params': {'skip_download': 'm3u8'},
50 'url': 'http://www.tf1.fr/tf1/koh-lanta/videos/replay-koh-lanta-22-mai-2015.html',
51 'only_matching': True,
53 'url': 'http://www.tf1.fr/hd1/documentaire/videos/mylene-farmer-d-une-icone.html',
54 'only_matching': True,
57 def _real_extract(self
, url
):
58 program_slug
, slug
= self
._match
_valid
_url
(url
).groups()
59 video
= self
._download
_json
(
60 'https://www.tf1.fr/graphql/web', slug
, query
={
61 'id': '9b80783950b85247541dd1d851f9cc7fa36574af015621f853ab111a679ce26f',
62 'variables': json
.dumps({
63 'programSlug': program_slug
,
66 })['data']['videoBySlug']
67 wat_id
= video
['streamId']
70 for tag
in (video
.get('tags') or []):
71 label
= tag
.get('label')
76 decoration
= video
.get('decoration') or {}
79 for source
in (try_get(decoration
, lambda x
: x
['image']['sources'], list) or []):
80 source_url
= source
.get('url')
85 'width': int_or_none(source
.get('width')),
89 '_type': 'url_transparent',
91 'url': 'wat:' + wat_id
,
92 'title': video
.get('title'),
93 'thumbnails': thumbnails
,
94 'description': decoration
.get('description'),
95 'timestamp': parse_iso8601(video
.get('date')),
96 'duration': int_or_none(try_get(video
, lambda x
: x
['publicPlayingInfos']['duration'])),
98 'series': decoration
.get('programLabel'),
99 'season_number': int_or_none(video
.get('season')),
100 'episode_number': int_or_none(video
.get('episode')),