]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/sixplay.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
13 class SixPlayIE(InfoExtractor
):
14 _VALID_URL
= r
'(?:6play:|https?://(?:www\.)?6play\.fr/.+?-c_)(?P<id>[0-9]+)'
16 'url': 'http://www.6play.fr/jamel-et-ses-amis-au-marrakech-du-rire-p_1316/jamel-et-ses-amis-au-marrakech-du-rire-2015-c_11495320',
17 'md5': '42310bffe4ba3982db112b9cd3467328',
21 'title': 'Jamel et ses amis au Marrakech du rire 2015',
22 'description': 'md5:ba2149d5c321d5201b78070ee839d872',
26 def _real_extract(self
, url
):
27 video_id
= self
._match
_id
(url
)
28 clip_data
= self
._download
_json
(
29 'https://player.m6web.fr/v2/video/config/6play-auth/FR/%s.json' % video_id
,
31 video_data
= clip_data
['videoInfo']
33 quality_key
= qualities(['lq', 'sd', 'hq', 'hd'])
35 for source
in clip_data
['sources']:
36 source_type
, source_url
= source
.get('type'), source
.get('src')
37 if not source_url
or source_type
== 'hls/primetime':
39 ext
= mimetype2ext(source_type
) or determine_ext(source_url
)
41 formats
.extend(self
._extract
_m
3u8_formats
(
42 source_url
, video_id
, 'mp4', 'm3u8_native',
43 m3u8_id
='hls', fatal
=False))
44 formats
.extend(self
._extract
_f
4m
_formats
(
45 source_url
.replace('.m3u8', '.f4m'),
46 video_id
, f4m_id
='hds', fatal
=False))
48 quality
= source
.get('quality')
52 'quality': quality_key(quality
),
55 self
._sort
_formats
(formats
)
59 'title': video_data
['title'].strip(),
60 'description': video_data
.get('description'),
61 'duration': int_or_none(video_data
.get('duration')),
62 'series': video_data
.get('titlePgm'),