From dfb9323cf9f10c9a1fcb2ecc5532123441e9ffbb Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Sun, 5 May 2013 20:57:19 +0200 Subject: [PATCH] Clean up InaIE (Closes #823) --- youtube_dl/InfoExtractors.py | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index 0f506e618..854592df8 100755 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -4128,32 +4128,24 @@ class RedTubeIE(InfoExtractor): class InaIE(InfoExtractor): """Information Extractor for Ina.fr""" _VALID_URL = r'(?:http://)?(?:www.)?ina\.fr/video/(?PI[0-9]+)/.*' - IE_NAME = u'Ina' + def _real_extract(self,url): mobj = re.match(self._VALID_URL, url) - if mobj is None: - raise ExtractorError(u'Invalid URL: %s' % url) + video_id = mobj.group('id') - self.to_screen(u'video id : %s' % video_id) - mrss_url='http://player.ina.fr/notices/%s.mrss'%video_id - self.to_screen(u'mrss url : %s' % mrss_url) - video_extension = 'mp4' - webpage = self._download_webpage(mrss_url,video_id) - self.report_extraction(video_id) - reg1=r'.*?)]]>' - mobj = re.search(reg2,webpage) + + mobj = re.search(r'<!\[CDATA\[(?P<titre>.*?)]]>', webpage) if mobj is None: raise ExtractorError(u'Unable to extract title') video_title = mobj.group(1) - - self.to_screen(u'Titre de la video : %s' % video_title) return [{ 'id': video_id, @@ -4218,7 +4210,7 @@ def gen_extractors(): TumblrIE(), BandcampIE(), RedTubeIE(), - InaIE, + InaIE(), GenericIE() ] -- 2.40.0