if transcript.get('kind') != 'captions':
continue
lang = transcript.get('srclang')
- subtitles[lang] = [{
- 'url': compat_str(typographic.get('src')),
- 'ext': typographic.get('format')
- } for typographic in transcript.findall('./typographic')]
+ for typographic in transcript.findall('./typographic'):
+ sub_src = typographic.get('src')
+ if not sub_src:
+ continue
+ ext = typographic.get('format')
+ if ext == 'cea-608':
+ ext = 'scc'
+ subtitles.setdefault(lang, []).append({
+ 'url': compat_str(sub_src),
+ 'ext': ext
+ })
return subtitles
def _get_video_info(self, itemdoc, use_hls=True):
if mgid is None or ':' not in mgid:
mgid = self._search_regex(
- [r'data-mgid="(.*?)"', r'swfobject.embedSWF\(".*?(mgid:.*?)"'],
+ [r'data-mgid="(.*?)"', r'swfobject\.embedSWF\(".*?(mgid:.*?)"'],
webpage, 'mgid', default=None)
if not mgid: