3 import xml.etree.ElementTree
5 from .common import InfoExtractor
11 class FranceTVBaseInfoExtractor(InfoExtractor):
12 def _extract_video(self, video_id):
13 xml_desc = self._download_webpage(
14 'http://www.francetvinfo.fr/appftv/webservices/video/'
15 'getInfosOeuvre.php?id-diffusion='
16 + video_id, video_id, 'Downloading XML config')
17 info = xml.etree.ElementTree.fromstring(xml_desc.encode('utf-8'))
19 manifest_url = info.find('videos/video/url').text
20 video_url = manifest_url.replace('manifest.f4m', 'index_2_av.m3u8')
21 video_url = video_url.replace('/z/', '/i/')
22 thumbnail_path = info.find('image').text
24 return {'id': video_id,
27 'title': info.find('titre').text,
28 'thumbnail': compat_urlparse.urljoin('http://pluzz.francetv.fr', thumbnail_path),
29 'description': info.find('synopsis').text,
33 class PluzzIE(FranceTVBaseInfoExtractor):
34 IE_NAME = u'pluzz.francetv.fr'
35 _VALID_URL = r'https?://pluzz\.francetv\.fr/videos/(.*?)\.html'
38 u'url': u'http://pluzz.francetv.fr/videos/allo_rufo_saison5_,88439064.html',
39 u'file': u'88439064.mp4',
41 u'title': u'AllĂ´ Rufo',
42 u'description': u'md5:d909f1ebdf963814b65772aea250400e',
45 u'skip_download': True,
49 def _real_extract(self, url):
50 title = re.match(self._VALID_URL, url).group(1)
51 webpage = self._download_webpage(url, title)
52 video_id = self._search_regex(
53 r'data-diffusion="(\d+)"', webpage, 'ID')
54 return self._extract_video(video_id)
57 class FranceTvInfoIE(FranceTVBaseInfoExtractor):
58 IE_NAME = u'francetvinfo.fr'
59 _VALID_URL = r'https?://www\.francetvinfo\.fr/replay.*/(?P<title>.+).html'
62 u'url': u'http://www.francetvinfo.fr/replay-jt/france-3/soir-3/jt-grand-soir-3-lundi-26-aout-2013_393427.html',
63 u'file': u'84981923.mp4',
68 u'skip_download': True,
72 def _real_extract(self, url):
73 mobj = re.match(self._VALID_URL, url)
74 page_title = mobj.group('title')
75 webpage = self._download_webpage(url, page_title)
76 video_id = self._search_regex(r'id-video=(\d+?)"', webpage, u'video id')
77 return self._extract_video(video_id)