1 from .canvas
import CanvasIE
2 from .common
import InfoExtractor
3 from ..compat
import compat_urllib_parse_unquote
10 class KetnetIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://(?:www\.)?ketnet\.be/(?P<id>(?:[^/]+/)*[^/?#&]+)'
13 'url': 'https://www.ketnet.be/kijken/n/nachtwacht/3/nachtwacht-s3a1-de-greystook',
14 'md5': '37b2b7bb9b3dcaa05b67058dc3a714a9',
16 'id': 'pbs-pub-aef8b526-115e-4006-aa24-e59ff6c6ef6f$vid-ddb815bf-c8e7-467b-8879-6bad7a32cebd',
18 'title': 'Nachtwacht - Reeks 3: Aflevering 1',
19 'description': 'De Nachtwacht krijgt te maken met een parasiet',
20 'thumbnail': r
're:^https?://.*\.jpg$',
22 'timestamp': 1609225200,
23 'upload_date': '20201229',
24 'series': 'Nachtwacht',
26 'episode': 'De Greystook',
29 'expected_warnings': ['is not a supported codec', 'Unknown MIME type'],
31 'url': 'https://www.ketnet.be/themas/karrewiet/jaaroverzicht-20200/karrewiet-het-jaar-van-black-mamba',
32 'only_matching': True,
35 def _real_extract(self
, url
):
36 display_id
= self
._match
_id
(url
)
38 video
= self
._download
_json
(
39 'https://senior-bff.ketnet.be/graphql', display_id
, query
={
41 video(id: "content/ketnet/nl/%s.model.json") {
55 mz_id
= compat_urllib_parse_unquote(video
['mediaReference'])
58 '_type': 'url_transparent',
60 'title': video
['titleVideodetail'],
61 'url': 'https://mediazone.vrt.be/api/v1/ketnet/assets/' + mz_id
,
62 'thumbnail': video
.get('imageUrl'),
63 'description': video
.get('description'),
64 'timestamp': parse_iso8601(video
.get('publicationDate')),
65 'series': video
.get('programTitle'),
66 'season': video
.get('seasonTitle'),
67 'episode': video
.get('subtitleVideodetail'),
68 'episode_number': int_or_none(video
.get('episodeNr')),
69 'ie_key': CanvasIE
.ie_key(),