[ie/dropbox] Fix password-protected video extraction (#11636)
[yt-dlp3.git] / yt_dlp / extractor / graspop.py
blob09371f8c46381d662defc5aa137d456f3a6eefee
1 from .common import InfoExtractor
2 from ..utils import update_url, url_or_none
3 from ..utils.traversal import traverse_obj
6 class GraspopIE(InfoExtractor):
7 _VALID_URL = r'https?://vod\.graspop\.be/[a-z]{2}/(?P<id>\d+)/'
8 _TESTS = [{
9 'url': 'https://vod.graspop.be/fr/101556/thy-art-is-murder-concert/',
10 'info_dict': {
11 'id': '101556',
12 'ext': 'mp4',
13 'title': 'Thy Art Is Murder',
14 'thumbnail': r're:https://cdn-mds\.pickx\.be/festivals/v3/global/original/.+\.jpg',
18 def _real_extract(self, url):
19 video_id = self._match_id(url)
20 metadata = self._download_json(
21 f'https://tv.proximus.be/MWC/videocenter/festivals/{video_id}/stream', video_id)
23 return {
24 'id': video_id,
25 'formats': self._extract_m3u8_formats(
26 # Downgrade manifest request to avoid incomplete certificate chain error
27 update_url(metadata['source']['assetUri'], scheme='http'), video_id, 'mp4'),
28 **traverse_obj(metadata, {
29 'title': ('name', {str}),
30 'thumbnail': ('source', 'poster', {url_or_none}),
31 }),