- format_url = widget['_stream']['json'][0]
-
- if format_url.endswith('.f4m'):
- # Skip f4m - these URLs just return a 403
- formats.append({
- 'format_id': 'f4m-' + widget['_quality'],
- 'url': format_url,
- 'preference': -1001,
- })
- elif format_url.endswith('m3u8'):
+ format_url = url_or_none(try_get(
+ widget, lambda x: x['_stream']['json'][0]))
+ if not format_url:
+ continue
+ ext = determine_ext(format_url)
+ if ext == 'f4m':
+ formats.extend(self._extract_f4m_formats(
+ format_url + '?hdcore=3.11.0',
+ video_id, f4m_id='hds', fatal=False))
+ elif ext == 'm3u8':