mirror of https://github.com/yt-dlp/yt-dlp
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
11 years ago
|
from __future__ import unicode_literals
|
||
|
|
||
11 years ago
|
from .common import InfoExtractor
|
||
|
|
||
|
|
||
|
class DefenseGouvFrIE(InfoExtractor):
|
||
11 years ago
|
IE_NAME = 'defense.gouv.fr'
|
||
9 years ago
|
_VALID_URL = r'https?://.*?\.defense\.gouv\.fr/layout/set/ligthboxvideo/base-de-medias/webtv/(?P<id>[^/?#]*)'
|
||
11 years ago
|
|
||
|
_TEST = {
|
||
11 years ago
|
'url': 'http://www.defense.gouv.fr/layout/set/ligthboxvideo/base-de-medias/webtv/attaque-chimique-syrienne-du-21-aout-2013-1',
|
||
|
'md5': '75bba6124da7e63d2d60b5244ec9430c',
|
||
10 years ago
|
'info_dict': {
|
||
|
'id': '11213',
|
||
|
'ext': 'mp4',
|
||
|
'title': 'attaque-chimique-syrienne-du-21-aout-2013-1'
|
||
11 years ago
|
}
|
||
11 years ago
|
}
|
||
|
|
||
|
def _real_extract(self, url):
|
||
10 years ago
|
title = self._match_id(url)
|
||
11 years ago
|
webpage = self._download_webpage(url, title)
|
||
10 years ago
|
|
||
11 years ago
|
video_id = self._search_regex(
|
||
|
r"flashvars.pvg_id=\"(\d+)\";",
|
||
|
webpage, 'ID')
|
||
10 years ago
|
|
||
10 years ago
|
json_url = (
|
||
|
'http://static.videos.gouv.fr/brightcovehub/export/json/%s' %
|
||
|
video_id)
|
||
10 years ago
|
info = self._download_json(json_url, title, 'Downloading JSON config')
|
||
|
video_url = info['renditions'][0]['url']
|
||
|
|
||
|
return {
|
||
|
'id': video_id,
|
||
|
'ext': 'mp4',
|
||
|
'url': video_url,
|
||
|
'title': title,
|
||
|
}
|