From 84db81815af6787d91188ca065cc9ced4d83a4ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Tue, 3 Dec 2013 14:58:24 +0100 Subject: Move common code for extractors based in MTV services to a new base class Removes the duplication of the thumbnail extraction code (only MTVIE needs to override it) --- youtube_dl/extractor/comedycentral.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'youtube_dl/extractor/comedycentral.py') diff --git a/youtube_dl/extractor/comedycentral.py b/youtube_dl/extractor/comedycentral.py index 41ef9ad47..53579aa27 100644 --- a/youtube_dl/extractor/comedycentral.py +++ b/youtube_dl/extractor/comedycentral.py @@ -1,7 +1,7 @@ import re from .common import InfoExtractor -from .mtv import MTVIE, _media_xml_tag +from .mtv import MTVServicesInfoExtractor from ..utils import ( compat_str, compat_urllib_parse, @@ -11,7 +11,7 @@ from ..utils import ( ) -class ComedyCentralIE(MTVIE): +class ComedyCentralIE(MTVServicesInfoExtractor): _VALID_URL = r'http://www.comedycentral.com/(video-clips|episodes|cc-studios)/(?P.*)' _FEED_URL = u'http://comedycentral.com/feeds/mrss/' @@ -25,12 +25,6 @@ class ComedyCentralIE(MTVIE): u'description': u'After a certain point, breastfeeding becomes c**kblocking.', }, } - # Overwrite MTVIE properties we don't want - _TESTS = [] - - def _get_thumbnail_url(self, uri, itemdoc): - search_path = '%s/%s' % (_media_xml_tag('group'), _media_xml_tag('thumbnail')) - return itemdoc.find(search_path).attrib['url'] def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) -- cgit v1.2.3