]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/clubic.py
14f215c5c27e3001414e512e7a1bf06f725cd8b0
2 from __future__
import unicode_literals
7 from .common
import InfoExtractor
14 class ClubicIE(InfoExtractor
):
15 _VALID_URL
= r
'http://(?:www\.)?clubic\.com/video/[^/]+/video.*-(?P<id>[0-9]+)\.html'
18 'url': 'http://www.clubic.com/video/clubic-week/video-clubic-week-2-0-le-fbi-se-lance-dans-la-photo-d-identite-448474.html',
19 'md5': '1592b694ba586036efac1776b0b43cd3',
23 'title': 'Clubic Week 2.0 : le FBI se lance dans la photo d\u0092identité',
24 'description': 're:Gueule de bois chez Nokia. Le constructeur a indiqué cette.*',
25 'thumbnail': 're:^http://img\.clubic\.com/.*\.jpg$',
29 def _real_extract(self
, url
):
30 mobj
= re
.match(self
._VALID
_URL
, url
)
31 video_id
= mobj
.group('id')
33 player_url
= 'http://player.m6web.fr/v1/player/clubic/%s.html' % video_id
34 player_page
= self
._download
_webpage
(player_url
, video_id
)
36 config_json
= self
._search
_regex
(
37 r
'(?m)M6\.Player\.config\s*=\s*(\{.+?\});$', player_page
,
39 config
= json
.loads(config_json
)
41 video_info
= config
['videoInfo']
42 sources
= config
['sources']
43 quality_order
= qualities(['sd', 'hq'])
46 'format_id': src
['streamQuality'],
48 'quality': quality_order(src
['streamQuality']),
50 self
._sort
_formats
(formats
)
54 'title': video_info
['title'],
56 'description': clean_html(video_info
.get('description')),
57 'thumbnail': config
.get('poster'),