X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Flifenews.py;h=7a431a274abc5b189af8ee8779f6024f430704c7;hb=43b81eb98afb8958b9a31220bf710a97751df5be;hp=7b7185f9adb69f37dee1e4c4b468de8a5a95a556;hpb=4edff78531c42aa126b02a9b792f84d2775c2172;p=youtube-dl diff --git a/youtube_dl/extractor/lifenews.py b/youtube_dl/extractor/lifenews.py index 7b7185f9a..7a431a274 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'