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/.+?[\?&]v(?:ideo)?=(?P<id>\d+)'
21 'url': 'http://www.tvigle.ru/category/cinema/1608/?video=503081',
22 'md5': '09afba4616666249f087efc6dcf83cb3',
27 'description': 'md5:f5a42970f50648cee3d7ad740f3ae769',
28 'upload_date': '20110919',
32 'url': 'http://www.tvigle.ru/category/men/vysotskiy_vospominaniya02/?flt=196&v=676433',
33 'md5': 'e7efe5350dd5011d0de6550b53c3ba7b',
37 'title': 'Ведущий телепрограммы «60 минут» (США) о Владимире Высоцком',
38 'description': 'md5:027f7dc872948f14c96d19b4178428a4',
39 'upload_date': '20121218',
44 def _real_extract(self, url):
45 mobj = re.match(self._VALID_URL, url)
46 video_id = mobj.group('id')
48 video_data = self._download_xml(
49 'http://www.tvigle.ru/xml/single.php?obj=%s' % video_id, video_id, 'Downloading video XML')
51 video = video_data.find('./video')
53 title = video.get('name')
54 description = video.get('anons')
56 description = clean_html(description)
57 thumbnail = video_data.get('img')
58 upload_date = unified_strdate(video.get('date'))
59 like_count = int_or_none(video.get('vtp'))
62 for num, (format_id, format_note) in enumerate([['low_file', 'SQ'], ['file', 'HQ'], ['hd', 'HD 720']]):
63 video_url = video.get(format_id)
68 'format_id': format_id,
69 'format_note': format_note,
73 self._sort_formats(formats)
78 'description': description,
79 'thumbnail': thumbnail,
80 'upload_date': upload_date,
81 'like_count': like_count,