- if stream.get('type') == "hls":
- formats.extend(self._extract_m3u8_formats(
- stream.get('url'),
- broadcaster_id,
- ext='mp4',
- m3u8_id='hls',
- preference=stream.get('quality', 100),
- live=True
- ))
- elif stream.get('type') == 'rtmp':
- url = stream.get('url') + '/' + stream.get('stream_name')
+ stream_url = stream.get('url')
+ if not stream_url:
+ continue
+ stream_type = stream.get('type')
+ if stream_type == 'hls':
+ m3u8_formats = self._extract_m3u8_formats(
+ stream_url, broadcaster_id, ext='mp4', m3u8_id='hls',
+ live=True)
+ for f in m3u8_formats:
+ f['quality'] = int_or_none(stream.get('quality', 100))
+ formats.extend(m3u8_formats)
+ elif stream_type == 'rtmp':
+ stream_name = stream.get('stream_name')
+ if not stream_name:
+ continue