def _get_streams(self):
    info = self._get_stream_info(self.url)
    if (not info):
        return
    formats = info.get('fmt_list')
    streams = {}
    protected = False
    for stream_info in info.get('url_encoded_fmt_stream_map', []):
        if stream_info.get('s'):
            protected = True
            continue
        stream = HTTPStream(self.session, stream_info['url'])
        name = (formats.get(stream_info['itag']) or stream_info['quality'])
        if stream_info.get('stereo3d'):
            name += '_3d'
        streams[name] = stream
    adaptive_streams = {}
    best_audio_itag = None
    for stream_info in info.get('adaptive_fmts', []):
        if stream_info.get('s'):
            protected = True
            continue
        stream_params = dict(parse_qsl(stream_info['url']))
        if ('itag' not in stream_params):
            continue
        itag = int(stream_params['itag'])
        adaptive_streams[itag] = stream_info['url']
        (stream_type, stream_format) = stream_info['type']
        if (stream_type == 'audio'):
            stream = HTTPStream(self.session, stream_info['url'])
            name = 'audio_{0}'.format(stream_format)
            streams[name] = stream
            if ((best_audio_itag is None) or (self.adp_audio[itag] > self.adp_audio[best_audio_itag])):
                best_audio_itag = itag
    if (best_audio_itag and adaptive_streams and MuxedStream.is_usable(self.session)):
        aurl = adaptive_streams[best_audio_itag]
        for (itag, name) in self.adp_video.items():
            if (itag in adaptive_streams):
                vurl = adaptive_streams[itag]
                streams[name] = MuxedStream(self.session, HTTPStream(self.session, vurl), HTTPStream(self.session, aurl))
    hls_playlist = info.get('hlsvp')
    if hls_playlist:
        try:
            hls_streams = HLSStream.parse_variant_playlist(self.session, hls_playlist, headers=HLS_HEADERS, namekey='pixels')
            streams.update(hls_streams)
        except IOError as err:
            self.logger.warning('Failed to extract HLS streams: {0}', err)
    if ((not streams) and protected):
        raise PluginError('This plugin does not support protected videos, try youtube-dl instead')
    return streams
def _get_streams(self):
    info = self._get_stream_info(self.url)
    if (not info):
        return
    formats = info.get('fmt_list')
    streams = {}
    protected = False
    for stream_info in info.get('url_encoded_fmt_stream_map', []):
        if stream_info.get('s'):
            protected = True
            continue
        stream = HTTPStream(self.session, stream_info['url'])
        name = (formats.get(stream_info['itag']) or stream_info['quality'])
        if stream_info.get('stereo3d'):
            name += '_3d'
        streams[name] = stream
    adaptive_streams = {}
    best_audio_itag = None
    for stream_info in info.get('adaptive_fmts', []):
        if stream_info.get('s'):
            protected = True
            continue
        stream_params = dict(parse_qsl(stream_info['url']))
        if ('itag' not in stream_params):
            continue
        itag = int(stream_params['itag'])
        adaptive_streams[itag] = stream_info['url']
        (stream_type, stream_format) = stream_info['type']
        if (stream_type == 'audio'):
            stream = HTTPStream(self.session, stream_info['url'])
            name = 'audio_{0}'.format(stream_format)
            streams[name] = stream
            if ((best_audio_itag is None) or (self.adp_audio[itag] > self.adp_audio[best_audio_itag])):
                best_audio_itag = itag
    if (best_audio_itag and adaptive_streams and MuxedStream.is_usable(self.session)):
        aurl = adaptive_streams[best_audio_itag]
        for (itag, name) in self.adp_video.items():
            if (itag in adaptive_streams):
                vurl = adaptive_streams[itag]
                streams[name] = MuxedStream(self.session, HTTPStream(self.session, vurl), HTTPStream(self.session, aurl))
    hls_playlist = info.get('hlsvp')
    if hls_playlist:
        try:
            hls_streams = HLSStream.parse_variant_playlist(self.session, hls_playlist, headers=HLS_HEADERS, namekey='pixels')
            streams.update(hls_streams)
        except IOError as err:
            self.logger.warning('Failed to extract HLS streams: {0}', err)
    if ((not streams) and protected):
        raise PluginError('This plugin does not support protected videos, try youtube-dl instead')
    return streams