]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/defense.py
424d960da95fc54ed7759e89a941f87b3da59801
4 from .common
import InfoExtractor
7 class DefenseGouvFrIE(InfoExtractor
):
8 _IE_NAME
= 'defense.gouv.fr'
9 _VALID_URL
= (r
'http://.*?\.defense\.gouv\.fr/layout/set/'
10 r
'ligthboxvideo/base-de-medias/webtv/(.*)')
13 u
'url': (u
'http://www.defense.gouv.fr/layout/set/ligthboxvideo/'
14 u
'base-de-medias/webtv/attaque-chimique-syrienne-du-21-aout-2013-1'),
15 u
'file': u
'11213.mp4',
16 u
'md5': u
'75bba6124da7e63d2d60b5244ec9430c',
18 "title": "attaque-chimique-syrienne-du-21-aout-2013-1"
22 def _real_extract(self
, url
):
23 title
= re
.match(self
._VALID
_URL
, url
).group(1)
24 webpage
= self
._download
_webpage
(url
, title
)
25 video_id
= self
._search
_regex
(
26 r
"flashvars.pvg_id=\"(\d
+)\";",
29 json_url = ('http://static.videos.gouv.fr/brightcovehub/export/json/'
31 info = self._download_webpage(json_url, title,
32 'Downloading JSON config')
33 video_url = json.loads(info)['renditions'][0]['url']
35 return {'id': video_id,