From 999d569176214cd5ffca7beb2ee507eac098d56a Mon Sep 17 00:00:00 2001 From: Thomas Christlieb Date: Mon, 13 Feb 2017 16:36:43 +0100 Subject: [PATCH] Fixed Lemonde Extractor --- youtube_dl/extractor/lemonde.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/lemonde.py b/youtube_dl/extractor/lemonde.py index 42568f315..c27d854ea 100644 --- a/youtube_dl/extractor/lemonde.py +++ b/youtube_dl/extractor/lemonde.py @@ -2,6 +2,11 @@ from __future__ import unicode_literals from .common import InfoExtractor +from ..utils import ( + get_element_by_class, + extract_attributes, +) + class LemondeIE(InfoExtractor): _VALID_URL = r'https?://(?:.+?\.)?lemonde\.fr/(?:[^/]+/)*(?P[^/]+)\.html' @@ -28,7 +33,11 @@ class LemondeIE(InfoExtractor): webpage = self._download_webpage(url, display_id) - digiteka_url = self._proto_relative_url(self._search_regex( + video_url = self._proto_relative_url(self._search_regex( r'url\s*:\s*(["\'])(?P(?:https?://)?//(?:www\.)?(?:digiteka\.net|ultimedia\.com)/deliver/.+?)\1', - webpage, 'digiteka url', group='url')) - return self.url_result(digiteka_url, 'Digiteka') + webpage, 'digiteka url', group='url', default=None)) + + if not video_url: + video_url = extract_attributes(get_element_by_class('video_player', webpage))['src'] + + return self.url_result(video_url, 'Digiteka')