1 from __future__ import unicode_literals
5 from .common import InfoExtractor
11 class LA7IE(InfoExtractor):
14 https?://(?:www\.)?la7\.tv/
16 richplayer/\?assetid=|
22 'url': 'http://www.la7.tv/richplayer/?assetid=50355319',
23 'file': '50355319.mp4',
24 'md5': 'ec7d1f0224d20ba293ab56cf2259651f',
27 'description': 'Un film di Paolo Sorrentino con Toni Servillo, Anna Bonaiuto, Giulio Bosetti e Flavio Bucci',
30 'skip': 'Blocked in the US',
33 def _real_extract(self, url):
34 mobj = re.match(self._VALID_URL, url)
35 video_id = mobj.group('id')
37 xml_url = 'http://www.la7.tv/repliche/content/index.php?contentId=%s' % video_id
38 doc = self._download_xml(xml_url, video_id)
40 video_title = doc.find('title').text
41 description = doc.find('description').text
42 duration = parse_duration(doc.find('duration').text)
43 thumbnail = doc.find('img').text
44 view_count = int(doc.find('views').text)
46 prefix = doc.find('.//fqdn').text.strip().replace('auto:', 'http:')
49 'format': vnode.find('quality').text,
50 'tbr': int(vnode.find('quality').text),
51 'url': vnode.find('fms').text.strip().replace('mp4:', prefix),
52 } for vnode in doc.findall('.//videos/video')]
53 self._sort_formats(formats)
58 'description': description,
59 'thumbnail': thumbnail,
62 'view_count': view_count,