- formats.extend(self._extract_m3u8_formats(
- manifest_url, video_id, 'mp4', headers=headers, m3u8_id='hls',
- fatal=live, live=live, errnote='No HLS formats found'))
- self._sort_formats(formats)
+ smil = None
+ if player_id and fw_ssid:
+ smil = self._download_xml(
+ f'https://link.theplatform.com/s/{pdk_acct}/{player_id}', video_id,
+ note='Downloading SMIL data', query=query, fatal=is_live)
+ if not isinstance(smil, xml.etree.ElementTree.Element):
+ smil = None
+ subtitles = self._parse_smil_subtitles(smil, default_ns) if smil is not None else {}
+ for video in smil.findall(self._xpath_ns('.//video', default_ns)) if smil is not None else []:
+ info['duration'] = float_or_none(remove_end(video.get('dur'), 'ms'), 1000)
+ video_src_url = video.get('src')
+ ext = mimetype2ext(video.get('type'), default=determine_ext(video_src_url))
+ if ext == 'm3u8':
+ fmts, subs = self._extract_m3u8_formats_and_subtitles(
+ video_src_url, video_id, 'mp4', m3u8_id='hls', fatal=is_live,
+ live=is_live, errnote='No HLS formats found')
+ formats.extend(fmts)
+ self._merge_subtitles(subs, target=subtitles)
+ elif video_src_url:
+ formats.append({
+ 'url': video_src_url,
+ 'format_id': f'https-{ext}',
+ 'ext': ext,
+ 'width': int_or_none(video.get('width')),
+ 'height': int_or_none(video.get('height')),
+ })
+
+ if not formats:
+ self.raise_no_formats('No video content found in webpage', expected=True)
+ elif is_live:
+ try:
+ self._request_webpage(
+ HEADRequest(formats[0]['url']), video_id, note='Checking live status')
+ except ExtractorError:
+ raise UserNotLive(video_id=channel)