2 from __future__ import unicode_literals
6 from .common import InfoExtractor
14 class TvigleIE(InfoExtractor):
16 IE_DESC = 'Интернет-телевидение Tvigle.ru'
17 _VALID_URL = r'http://(?:www\.)?tvigle\.ru/category/.+?video=(?P<id>\d+)'
20 'url': 'http://www.tvigle.ru/category/cinema/1608/?video=503081',
21 'md5': '09afba4616666249f087efc6dcf83cb3',
26 'description': 'md5:f5a42970f50648cee3d7ad740f3ae769',
27 'upload_date': '20110919',
31 def _real_extract(self, url):
32 mobj = re.match(self._VALID_URL, url)
33 video_id = mobj.group('id')
35 video_data = self._download_xml(
36 'http://www.tvigle.ru/xml/single.php?obj=%s' % video_id, video_id, 'Downloading video XML')
38 video = video_data.find('./video')
40 title = video.get('name')
41 description = video.get('anons')
43 description = clean_html(description)
44 thumbnail = video_data.get('img')
45 upload_date = unified_strdate(video.get('date'))
46 like_count = int_or_none(video.get('vtp'))
49 for num, (format_id, format_note) in enumerate([['low_file', 'SQ'], ['file', 'HQ'], ['hd', 'HD 720']]):
50 video_url = video.get(format_id)
55 'format_id': format_id,
56 'format_note': format_note,
60 self._sort_formats(formats)
65 'description': description,
66 'thumbnail': thumbnail,
67 'upload_date': upload_date,
68 'like_count': like_count,