1 from __future__ import unicode_literals
3 from .common import InfoExtractor
6 class KetnetIE(InfoExtractor):
7 _VALID_URL = r'https?://(?:www\.)?ketnet\.be/(?:[^/]+/)*(?P<id>[^/?#&]+)'
9 'url': 'https://www.ketnet.be/kijken/zomerse-filmpjes',
10 'md5': 'd907f7b1814ef0fa285c0475d9994ed7',
12 'id': 'zomerse-filmpjes',
14 'title': 'Gluur mee op de filmset en op Pennenzakkenrock',
15 'description': 'Gluur mee met Ghost Rockers op de filmset',
16 'thumbnail': 're:^https?://.*\.jpg$',
19 'url': 'https://www.ketnet.be/kijken/karrewiet/uitzending-8-september-2016',
20 'only_matching': True,
22 'url': 'https://www.ketnet.be/achter-de-schermen/sien-repeteert-voor-stars-for-life',
23 'only_matching': True,
26 def _real_extract(self, url):
27 video_id = self._match_id(url)
29 webpage = self._download_webpage(url, video_id)
31 config = self._parse_json(
33 r'(?s)playerConfig\s*=\s*({.+?})\s*;', webpage,
37 title = config['title']
39 formats = self._extract_m3u8_formats(
40 config['source']['hls'], video_id, 'mp4',
41 entry_protocol='m3u8_native', m3u8_id='hls')
42 self._sort_formats(formats)
47 'description': config.get('description'),
48 'thumbnail': config.get('image'),
49 'series': config.get('program'),
50 'episode': config.get('episode'),