1 from __future__ import unicode_literals
6 from .common import InfoExtractor
9 class DefenseGouvFrIE(InfoExtractor):
10 IE_NAME = 'defense.gouv.fr'
11 _VALID_URL = (r'http://.*?\.defense\.gouv\.fr/layout/set/'
12 r'ligthboxvideo/base-de-medias/webtv/(.*)')
15 'url': 'http://www.defense.gouv.fr/layout/set/ligthboxvideo/base-de-medias/webtv/attaque-chimique-syrienne-du-21-aout-2013-1',
17 'md5': '75bba6124da7e63d2d60b5244ec9430c',
19 "title": "attaque-chimique-syrienne-du-21-aout-2013-1"
23 def _real_extract(self, url):
24 title = re.match(self._VALID_URL, url).group(1)
25 webpage = self._download_webpage(url, title)
26 video_id = self._search_regex(
27 r"flashvars.pvg_id=\"(\d+)\";",
30 json_url = ('http://static.videos.gouv.fr/brightcovehub/export/json/'
32 info = self._download_webpage(json_url, title,
33 'Downloading JSON config')
34 video_url = json.loads(info)['renditions'][0]['url']
36 return {'id': video_id,