X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/af478477605bdf3f5d57562035885cfee905f379..415fdb62500dca2e22067a05008dfbf87c75b662:/youtube_dl/extractor/lifenews.py diff --git a/youtube_dl/extractor/lifenews.py b/youtube_dl/extractor/lifenews.py index 7b7185f..7a431a2 100644 --- a/youtube_dl/extractor/lifenews.py +++ b/youtube_dl/extractor/lifenews.py @@ -6,7 +6,8 @@ import re from .common import InfoExtractor from ..utils import ( int_or_none, - unified_strdate + unified_strdate, + ExtractorError, ) @@ -32,13 +33,11 @@ class LifeNewsIE(InfoExtractor): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('id') - webpage = self._download_webpage('http://lifenews.ru/mobile/news/%s' % video_id, video_id, 'Downloading page') + webpage = self._download_webpage('http://lifenews.ru/news/%s' % video_id, video_id, 'Downloading page') - video_url = self._html_search_regex( - r'', webpage, 'video URL') - - thumbnail = self._html_search_regex( - r'', webpage, 'video thumbnail') + videos = re.findall(r'[^"]+)".*?src="(?P', webpage) + if not videos: + raise ExtractorError('No media links available for %s' % video_id) title = self._og_search_title(webpage) TITLE_SUFFIX = ' - Первый по срочным новостям — LIFE | NEWS' @@ -50,20 +49,26 @@ class LifeNewsIE(InfoExtractor): view_count = self._html_search_regex( r'
(\d+)
', webpage, 'view count', fatal=False) comment_count = self._html_search_regex( - r'
(\d+)
', webpage, 'comment count', fatal=False) + r'
\s*(\d+)', webpage, 'comment count', fatal=False) upload_date = self._html_search_regex( r'