From af6199b6e17728ac1edba765aef0c7714e04b676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9stin=20Reed?= Date: Mon, 9 Jan 2017 18:22:53 +0100 Subject: [PATCH] [EllenTV] Improve --- youtube_dl/extractor/ellentv.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/ellentv.py b/youtube_dl/extractor/ellentv.py index 74bbc5c51..68e2e4360 100644 --- a/youtube_dl/extractor/ellentv.py +++ b/youtube_dl/extractor/ellentv.py @@ -1,9 +1,8 @@ # coding: utf-8 from __future__ import unicode_literals -import json - from .common import InfoExtractor +from .kaltura import KalturaIE from ..utils import ( ExtractorError, NO_DEFAULT, @@ -65,7 +64,7 @@ class EllenTVIE(InfoExtractor): if partner_id and kaltura_id: break - return self.url_result('kaltura:%s:%s' % (partner_id, kaltura_id), 'Kaltura') + return self.url_result('kaltura:%s:%s' % (partner_id, kaltura_id), KalturaIE.ie_key()) class EllenTVClipsIE(InfoExtractor): @@ -77,7 +76,7 @@ class EllenTVClipsIE(InfoExtractor): 'id': 'meryl-streep-vanessa-hudgens', 'title': 'Meryl Streep, Vanessa Hudgens', }, - 'playlist_mincount': 7, + 'playlist_mincount': 5, } def _real_extract(self, url): @@ -96,7 +95,7 @@ class EllenTVClipsIE(InfoExtractor): def _extract_playlist(self, webpage): json_string = self._search_regex(r'playerView.addClips\(\[\{(.*?)\}\]\);', webpage, 'json') try: - return json.loads('[{' + json_string + '}]') + return self._parse_json('[{' + json_string + '}]', 'playlist') except ValueError as ve: raise ExtractorError('Failed to download JSON', cause=ve) @@ -104,5 +103,5 @@ class EllenTVClipsIE(InfoExtractor): return [ self.url_result( 'kaltura:%s:%s' % (item['kaltura_partner_id'], item['kaltura_entry_id']), - 'Kaltura') + KalturaIE.ie_key()) for item in playlist]