aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDéstin Reed <trox1972@users.noreply.github.com>2016-09-30 20:03:25 +0200
committerDéstin Reed <trox1972@users.noreply.github.com>2016-09-30 20:03:25 +0200
commiteaf9b22f94f37487d75457423a9a293dee1b1d32 (patch)
tree7f1e4448fd6deb8fc93bf611f551e5a5cc9a14a2
parent8f0cf20ab987019c3ba66c375450f80bb1cfe281 (diff)
[clubic] Rely on _match_id and _parse_json
-rw-r--r--youtube_dl/extractor/clubic.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/youtube_dl/extractor/clubic.py b/youtube_dl/extractor/clubic.py
index 2fba93543..f7ee3a8f8 100644
--- a/youtube_dl/extractor/clubic.py
+++ b/youtube_dl/extractor/clubic.py
@@ -1,9 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
-import json
-import re
-
from .common import InfoExtractor
from ..utils import (
clean_html,
@@ -30,16 +27,14 @@ class ClubicIE(InfoExtractor):
}]
def _real_extract(self, url):
- mobj = re.match(self._VALID_URL, url)
- video_id = mobj.group('id')
+ video_id = self._match_id(url)
player_url = 'http://player.m6web.fr/v1/player/clubic/%s.html' % video_id
player_page = self._download_webpage(player_url, video_id)
- config_json = self._search_regex(
+ config = self._parse_json(self._search_regex(
r'(?m)M6\.Player\.config\s*=\s*(\{.+?\});$', player_page,
- 'configuration')
- config = json.loads(config_json)
+ 'configuration'), video_id)
video_info = config['videoInfo']
sources = config['sources']