]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/defense.py
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
6 class DefenseGouvFrIE(InfoExtractor
):
7 IE_NAME
= 'defense.gouv.fr'
8 _VALID_URL
= r
'http://.*?\.defense\.gouv\.fr/layout/set/ligthboxvideo/base-de-medias/webtv/(?P<id>[^/?#]*)'
11 'url': 'http://www.defense.gouv.fr/layout/set/ligthboxvideo/base-de-medias/webtv/attaque-chimique-syrienne-du-21-aout-2013-1',
12 'md5': '75bba6124da7e63d2d60b5244ec9430c',
16 'title': 'attaque-chimique-syrienne-du-21-aout-2013-1'
20 def _real_extract(self
, url
):
21 title
= self
._match
_id
(url
)
22 webpage
= self
._download
_webpage
(url
, title
)
24 video_id
= self
._search
_regex
(
25 r
"flashvars.pvg_id=\"(\d
+)\";",
28 json_url = ('http://static.videos.gouv.fr/brightcovehub/export/json/'
30 info = self._download_json(json_url, title, 'Downloading JSON config')
31 video_url = info['renditions'][0]['url']