]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/clubic.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
11 class ClubicIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?clubic\.com/video/(?:[^/]+/)*video.*-(?P<id>[0-9]+)\.html'
15 'url': 'http://www.clubic.com/video/clubic-week/video-clubic-week-2-0-le-fbi-se-lance-dans-la-photo-d-identite-448474.html',
16 'md5': '1592b694ba586036efac1776b0b43cd3',
20 'title': 'Clubic Week 2.0 : le FBI se lance dans la photo d\u0092identité',
21 'description': 're:Gueule de bois chez Nokia. Le constructeur a indiqué cette.*',
22 'thumbnail': 're:^http://img\.clubic\.com/.*\.jpg$',
25 'url': 'http://www.clubic.com/video/video-clubic-week-2-0-apple-iphone-6s-et-plus-mais-surtout-le-pencil-469792.html',
26 'only_matching': True,
29 def _real_extract(self
, url
):
30 video_id
= self
._match
_id
(url
)
32 player_url
= 'http://player.m6web.fr/v1/player/clubic/%s.html' % video_id
33 player_page
= self
._download
_webpage
(player_url
, video_id
)
35 config
= self
._parse
_json
(self
._search
_regex
(
36 r
'(?m)M6\.Player\.config\s*=\s*(\{.+?\});$', player_page
,
37 'configuration'), video_id
)
39 video_info
= config
['videoInfo']
40 sources
= config
['sources']
41 quality_order
= qualities(['sd', 'hq'])
44 'format_id': src
['streamQuality'],
46 'quality': quality_order(src
['streamQuality']),
48 self
._sort
_formats
(formats
)
52 'title': video_info
['title'],
54 'description': clean_html(video_info
.get('description')),
55 'thumbnail': config
.get('poster'),