X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fvesti.py;h=5ab7168808b10279932ba670165bc8190d5fceb0;hb=HEAD;hp=7773cec1447810afe64f9aa057f1905cd73036ab;hpb=72ca1d7f45488d746337cdf61a70ff25d9e8411b;p=youtube-dl diff --git a/youtube_dl/extractor/vesti.py b/youtube_dl/extractor/vesti.py index 7773cec14..5ab716880 100644 --- a/youtube_dl/extractor/vesti.py +++ b/youtube_dl/extractor/vesti.py @@ -1,19 +1,16 @@ -# encoding: utf-8 +# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor -from ..utils import ( - ExtractorError, - int_or_none -) +from ..utils import ExtractorError +from .rutv import RUTVIE class VestiIE(InfoExtractor): - IE_NAME = 'vesti' IE_DESC = 'Вести.Ru' - _VALID_URL = r'http://(?:.+?\.)?vesti\.ru/(?P.+)' + _VALID_URL = r'https?://(?:.+?\.)?vesti\.ru/(?P.+)' _TESTS = [ { @@ -30,6 +27,20 @@ class VestiIE(InfoExtractor): 'skip_download': True, }, }, + { + 'url': 'http://www.vesti.ru/doc.html?id=1349233', + 'info_dict': { + 'id': '773865', + 'ext': 'mp4', + 'title': 'Участники митинга штурмуют Донецкую областную администрацию', + 'description': 'md5:1a160e98b3195379b4c849f2f4958009', + 'duration': 210, + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + }, { 'url': 'http://www.vesti.ru/only_video.html?vid=576180', 'info_dict': { @@ -44,6 +55,20 @@ class VestiIE(InfoExtractor): 'skip_download': True, }, }, + { + 'url': 'http://hitech.vesti.ru/news/view/id/4000', + 'info_dict': { + 'id': '766888', + 'ext': 'mp4', + 'title': 'Вести.net: интернет-гиганты начали перетягивание программных "одеял"', + 'description': 'md5:65ddd47f9830c4f42ed6475f8730c995', + 'duration': 279, + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + }, { 'url': 'http://sochi2014.vesti.ru/video/index/video_id/766403', 'info_dict': { @@ -57,7 +82,7 @@ class VestiIE(InfoExtractor): # m3u8 download 'skip_download': True, }, - 'skip': 'Blocked outside Russia' + 'skip': 'Blocked outside Russia', }, { 'url': 'http://sochi2014.vesti.ru/live/play/live_id/301', @@ -72,7 +97,7 @@ class VestiIE(InfoExtractor): 'skip_download': True, }, 'skip': 'Translation has finished' - } + }, ] def _real_extract(self, url): @@ -81,91 +106,16 @@ class VestiIE(InfoExtractor): page = self._download_webpage(url, video_id, 'Downloading page') - mobj = re.search(r'', page) + mobj = re.search( + r']+?property="og:video"[^>]+?content="http://www\.vesti\.ru/i/flvplayer_videoHost\.swf\?vid=(?P\d+)', + page) if mobj: - video_type = 'video' - video_id = mobj.group('id') - else: - mobj = re.search( - r'\s*