1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-24 11:32:51 +08:00

Fixed Lemonde Extractor

This commit is contained in:
Thomas Christlieb 2017-02-13 16:36:43 +01:00
parent 89c6691f9d
commit 999d569176

View File

@ -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<id>[^/]+)\.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<url>(?: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')