X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Flifenews.py;h=1dfe7f77f4ccdefa0b076f71f6467644e465cb52;hb=af14ded75e10653b4713c23f8c428c6cd88610ad;hp=bb1bae643f6fce881d7778929f6aa878b81d948f;hpb=1877a140496155bcb8d560aa876ee02fbfe23193;p=youtube-dl diff --git a/youtube_dl/extractor/lifenews.py b/youtube_dl/extractor/lifenews.py index bb1bae643..1dfe7f77f 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, ) @@ -23,7 +24,7 @@ class LifeNewsIE(InfoExtractor): 'ext': 'mp4', 'title': 'МВД разыскивает мужчин, оставивших в IKEA сумку с автоматом', 'description': 'Камеры наблюдения гипермаркета зафиксировали троих мужчин, спрятавших оружейный арсенал в камере хранения.', - 'thumbnail': 'http://lifenews.ru/static/posts/2014/1/126342/.video.jpg', + 'thumbnail': 're:http://.*\.jpg', 'upload_date': '20140130', } } @@ -34,11 +35,9 @@ class LifeNewsIE(InfoExtractor): 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' @@ -53,17 +52,23 @@ class LifeNewsIE(InfoExtractor): r'
\s*(\d+)', webpage, 'comment count', fatal=False) upload_date = self._html_search_regex( - r'