from .common import InfoExtractor
from ..utils import (
- RegexNotFoundError,
+ ExtractorError,
unescapeHTML
)
{
'url': 'http://www.ntv.ru/kino/Koma_film',
'info_dict': {
- 'id': '750783',
+ 'id': '758100',
'ext': 'flv',
- 'title': 'Остросюжетный фильм «Кома» \97 4 апреля вечером на НТВ',
- 'description': 'Остросюжетный фильм «Кома» \97 4 апреля вечером на НТВ',
- 'duration': 28,
+ 'title': 'Остросюжетный фильм «Кома»',
+ 'description': 'Остросюжетный фильм «Кома»',
+ 'duration': 5592,
},
'params': {
# rtmp download
page = self._download_webpage(url, video_id, 'Downloading page')
- def extract(patterns, name, page, fatal=False):
- for pattern in patterns:
- mobj = re.search(pattern, page)
- if mobj:
- return mobj.group(1)
- if fatal:
- raise RegexNotFoundError(u'Unable to extract %s' % name)
- return None
+ for pattern in self._VIDEO_ID_REGEXES:
+ mobj = re.search(pattern, page)
+ if mobj:
+ break
- video_id = extract(self._VIDEO_ID_REGEXES, 'video id', page, fatal=True)
+ if not mobj:
+ raise ExtractorError('No media links available for %s' % video_id)
+
+ video_id = mobj.group(1)
player = self._download_xml('http://www.ntv.ru/vi%s/' % video_id, video_id, 'Downloading video XML')
title = unescapeHTML(player.find('./data/title').text)
'7': 'video2',
}
+ app = apps[puid22] if puid22 in apps else apps['4']
+
formats = []
for format_id in ['', 'hi', 'webm']:
file = video.find('./%sfile' % format_id)
if file is None:
continue
size = video.find('./%ssize' % format_id)
- app = apps[puid22] if puid22 in apps else apps['4']
formats.append({
'url': 'rtmp://media.ntv.ru/%s' % app,
'app': app,