X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Flifenews.py;h=1f1e23dc3b2cfcf997c78c3d56ac470b2f254990;hb=5f6a1245ffa9276c1af59b0835afeef67e2fb5b1;hp=7b7185f9adb69f37dee1e4c4b468de8a5a95a556;hpb=18395217c489f1b324ea7b85305f8b2edaf237c9;p=youtube-dl diff --git a/youtube_dl/extractor/lifenews.py b/youtube_dl/extractor/lifenews.py index 7b7185f9a..1f1e23dc3 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', } } @@ -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'