2 from __future__ import unicode_literals
4 from .common import InfoExtractor
10 class FiveTVIE(InfoExtractor):
11 _VALID_URL = r'http://(?:www\.)?5-tv\.ru/[^/]*/(?P<id>\d+)'
14 'url': 'http://5-tv.ru/news/96814/',
15 'md5': 'bbff554ad415ecf5416a2f48c22d9283',
19 'title': 'Россияне выбрали имя для общенациональной платежной системы',
20 'description': 'md5:a8aa13e2b7ad36789e9f77a74b6de660',
21 'thumbnail': 're:^https?://.*\.jpg$',
28 'url': 'http://5-tv.ru/video/1021729/',
29 'md5': '299c8b72960efc9990acd2c784dc2296',
33 'title': '3D принтер',
34 'description': 'md5:d76c736d29ef7ec5c0cf7d7c65ffcb41',
35 'thumbnail': 're:^https?://.*\.jpg$',
43 def _real_extract(self, url):
44 video_id = self._match_id(url)
46 webpage = self._download_webpage(url, video_id)
48 video_link = self._search_regex(
49 r'(<a.*?class="videoplayer">)', webpage, 'video link')
51 url = self._search_regex(r'href="([^"]+)"', video_link, 'video url')
52 width = int_or_none(self._search_regex(
53 r'width:(\d+)px', video_link, 'width', default=None, fatal=False))
54 height = int_or_none(self._search_regex(
55 r'height:(\d+)px', video_link, 'height', default=None, fatal=False))
56 duration = int_or_none(self._og_search_property(
57 'video:duration', webpage, 'duration'))
63 'title': self._og_search_title(webpage),
64 'description': self._og_search_description(webpage),
65 'thumbnail': self._og_search_thumbnail(webpage),