import base64
import json
import re
+import xml.etree.ElementTree
from .common import InfoExtractor
from .theplatform import ThePlatformIE, default_ns
'chapters': 'count:1',
'tags': 'count:4',
'thumbnail': r're:https?://.+\.jpg',
+ 'categories': ['Series/The Tonight Show Starring Jimmy Fallon'],
+ 'media_type': 'Full Episode',
},
'params': {
'skip_download': 'm3u8',
'tags': 'count:10',
'age_limit': 0,
'thumbnail': r're:https?://.+\.jpg',
+ 'categories': ['Series/Quantum Leap 2022'],
+ 'media_type': 'Highlight',
},
'params': {
'skip_download': 'm3u8',
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)
- subtitles = self._parse_smil_subtitles(smil, default_ns) if smil else {}
- for video in smil.findall(self._xpath_ns('.//video', default_ns)) if smil else []:
+ 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))