2014-04-20 23:12:02 -06:00
|
|
|
from .common import InfoExtractor
|
|
|
|
from ..utils import (
|
|
|
|
clean_html,
|
|
|
|
qualities,
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class ClubicIE(InfoExtractor):
|
2023-11-25 20:09:59 -07:00
|
|
|
_WORKING = False
|
2016-03-21 09:36:32 -06:00
|
|
|
_VALID_URL = r'https?://(?:www\.)?clubic\.com/video/(?:[^/]+/)*video.*-(?P<id>[0-9]+)\.html'
|
2014-04-20 23:12:02 -06:00
|
|
|
|
2015-09-13 15:35:15 -06:00
|
|
|
_TESTS = [{
|
2014-04-20 23:12:02 -06:00
|
|
|
'url': 'http://www.clubic.com/video/clubic-week/video-clubic-week-2-0-le-fbi-se-lance-dans-la-photo-d-identite-448474.html',
|
|
|
|
'md5': '1592b694ba586036efac1776b0b43cd3',
|
|
|
|
'info_dict': {
|
|
|
|
'id': '448474',
|
|
|
|
'ext': 'mp4',
|
|
|
|
'title': 'Clubic Week 2.0 : le FBI se lance dans la photo d\u0092identité',
|
|
|
|
'description': 're:Gueule de bois chez Nokia. Le constructeur a indiqué cette.*',
|
2017-01-02 05:08:07 -07:00
|
|
|
'thumbnail': r're:^http://img\.clubic\.com/.*\.jpg$',
|
2024-06-11 17:09:58 -06:00
|
|
|
},
|
2015-09-13 15:35:15 -06:00
|
|
|
}, {
|
|
|
|
'url': 'http://www.clubic.com/video/video-clubic-week-2-0-apple-iphone-6s-et-plus-mais-surtout-le-pencil-469792.html',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
2014-04-20 23:12:02 -06:00
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2016-09-30 12:03:25 -06:00
|
|
|
video_id = self._match_id(url)
|
2014-04-20 23:12:02 -06:00
|
|
|
|
2024-06-11 17:09:58 -06:00
|
|
|
player_url = f'http://player.m6web.fr/v1/player/clubic/{video_id}.html'
|
2014-04-20 23:12:02 -06:00
|
|
|
player_page = self._download_webpage(player_url, video_id)
|
|
|
|
|
2016-09-30 12:03:25 -06:00
|
|
|
config = self._parse_json(self._search_regex(
|
2014-04-20 23:12:02 -06:00
|
|
|
r'(?m)M6\.Player\.config\s*=\s*(\{.+?\});$', player_page,
|
2016-09-30 12:03:25 -06:00
|
|
|
'configuration'), video_id)
|
2014-04-20 23:12:02 -06:00
|
|
|
|
|
|
|
video_info = config['videoInfo']
|
|
|
|
sources = config['sources']
|
|
|
|
quality_order = qualities(['sd', 'hq'])
|
|
|
|
|
|
|
|
formats = [{
|
|
|
|
'format_id': src['streamQuality'],
|
|
|
|
'url': src['src'],
|
|
|
|
'quality': quality_order(src['streamQuality']),
|
|
|
|
} for src in sources]
|
|
|
|
|
|
|
|
return {
|
|
|
|
'id': video_id,
|
|
|
|
'title': video_info['title'],
|
|
|
|
'formats': formats,
|
|
|
|
'description': clean_html(video_info.get('description')),
|
|
|
|
'thumbnail': config.get('poster'),
|
|
|
|
}
|