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