[cleanup] Remove dead extractors (#8604)
[yt-dlp3.git] / yt_dlp / extractor / clubic.py
blob716f259694681690492ca428345758b639ae01f5
1 from .common import InfoExtractor
2 from ..utils import (
3 clean_html,
4 qualities,
8 class ClubicIE(InfoExtractor):
9 _WORKING = False
10 _VALID_URL = r'https?://(?:www\.)?clubic\.com/video/(?:[^/]+/)*video.*-(?P<id>[0-9]+)\.html'
12 _TESTS = [{
13 'url': 'http://www.clubic.com/video/clubic-week/video-clubic-week-2-0-le-fbi-se-lance-dans-la-photo-d-identite-448474.html',
14 'md5': '1592b694ba586036efac1776b0b43cd3',
15 'info_dict': {
16 'id': '448474',
17 'ext': 'mp4',
18 'title': 'Clubic Week 2.0 : le FBI se lance dans la photo d\u0092identité',
19 'description': 're:Gueule de bois chez Nokia. Le constructeur a indiqué cette.*',
20 'thumbnail': r're:^http://img\.clubic\.com/.*\.jpg$',
22 }, {
23 'url': 'http://www.clubic.com/video/video-clubic-week-2-0-apple-iphone-6s-et-plus-mais-surtout-le-pencil-469792.html',
24 'only_matching': True,
27 def _real_extract(self, url):
28 video_id = self._match_id(url)
30 player_url = 'http://player.m6web.fr/v1/player/clubic/%s.html' % video_id
31 player_page = self._download_webpage(player_url, video_id)
33 config = self._parse_json(self._search_regex(
34 r'(?m)M6\.Player\.config\s*=\s*(\{.+?\});$', player_page,
35 'configuration'), video_id)
37 video_info = config['videoInfo']
38 sources = config['sources']
39 quality_order = qualities(['sd', 'hq'])
41 formats = [{
42 'format_id': src['streamQuality'],
43 'url': src['src'],
44 'quality': quality_order(src['streamQuality']),
45 } for src in sources]
47 return {
48 'id': video_id,
49 'title': video_info['title'],
50 'formats': formats,
51 'description': clean_html(video_info.get('description')),
52 'thumbnail': config.get('poster'),