+ live, media_id = re.match(self._VALID_URL, url).groups()
+ embed_page = self._download_webpage(
+ 'https://www.rtbf.be/auvio/embed/' + ('direct' if live else 'media'),
+ media_id, query={'id': media_id})
+ data = self._parse_json(self._html_search_regex(
+ r'data-media="([^"]+)"', embed_page, 'media data'), media_id)
+
+ error = data.get('error')
+ if error:
+ raise ExtractorError('%s said: %s' % (self.IE_NAME, error), expected=True)
+
+ provider = data.get('provider')
+ if provider in self._PROVIDERS:
+ return self.url_result(data['url'], self._PROVIDERS[provider])
+
+ title = data['title']
+ is_live = data.get('isLive')
+ if is_live:
+ title = self._live_title(title)
+ height_re = r'-(\d+)p\.'
+ formats = []
+
+ m3u8_url = data.get('urlHlsAes128') or data.get('urlHls')
+ if m3u8_url:
+ formats.extend(self._extract_m3u8_formats(
+ m3u8_url, media_id, 'mp4', m3u8_id='hls', fatal=False))