# Buggy code
def _get_streams(self):
    api = self._create_api()
    match = _url_re.match(self.url)
    media_id = int(match.group("media_id"))

    try:
        # the media.stream_data field is required, no stream data is returned otherwise
        info = api.get_info(
            media_id, fields=["media.stream_data"], schema=_media_schema
        )
    except CrunchyrollAPIError as err:
        raise PluginError("Media lookup error: {0}".format(err.msg))

    if not info:
        return

    streams = {}

    # The adaptive quality stream sometimes a subset of all the other streams listed, ultra is no included
    has_adaptive = any([s["quality"] == "adaptive" for s in info["streams"]])
    if has_adaptive:
        self.logger.debug("Loading streams from adaptive playlist")
        for stream in filter(lambda x: x["quality"] == "adaptive", info["streams"]):
            for q, s in HLSStream.parse_variant_playlist(
                self.session, stream["url"]
            ).items():
                # rename the bitrates to low, mid, or high. ultra doesn't seem to appear in the adaptive streams
                name = STREAM_NAMES.get(q, q)
                streams[name] = s

    # If there is no adaptive quality stream then parse each individual result
    for stream in info["streams"]:
        if stream["quality"] != "adaptive":
            # the video_encode_id indicates that the stream is not a variant playlist
            if "video_encode_id" in stream:
                streams[stream["quality"]] = HLSStream(self.session, stream["url"])
            else:
                # otherwise the stream url is actually a list of stream qualities
                for q, s in HLSStream.parse_variant_playlist(
                    self.session, stream["url"]
                ).items():
                    # rename the bitrates to low, mid, or high. ultra doesn't seem to appear in the adaptive streams
                    name = STREAM_NAMES.get(q, q)
                    streams[name] = s

    return streams


# Traceback (streamlink.plugin.crunchyroll.CrunchyrollAPIError)
Traceback (most recent call last):
File "runpy.py", line 193, in _run_module_as_main
File "runpy.py", line 85, in _run_code
File "C:\Users\kg\AppData\Local\Streamlink\bin\streamlink.exe\__main__.py", line 18, in <module>
File "C:\Users\kg\AppData\Local\Streamlink\pkgs\streamlink_cli\main.py", line 1024, in main
handle_url()
File "C:\Users\kg\AppData\Local\Streamlink\pkgs\streamlink_cli\main.py", line 585, in handle_url
streams = fetch_streams(plugin)
File "C:\Users\kg\AppData\Local\Streamlink\pkgs\streamlink_cli\main.py", line 465, in fetch_streams
sorting_excludes=args.stream_sorting_excludes)
File "C:\Users\kg\AppData\Local\Streamlink\pkgs\streamlink\plugin\plugin.py", line 317, in streams
ostreams = self._get_streams()
File "C:\Users\kg\AppData\Local\Streamlink\pkgs\streamlink\plugins\crunchyroll.py", line 306, in _get_streams
api = self._create_api()
File "C:\Users\kg\AppData\Local\Streamlink\pkgs\streamlink\plugins\crunchyroll.py", line 369, in _create_api
login = api.authenticate()
File "C:\Users\kg\AppData\Local\Streamlink\pkgs\streamlink\plugins\crunchyroll.py", line 217, in authenticate
data = self._api_call("authenticate", {"auth": self.auth}, schema=_login_schema)
File "C:\Users\kg\AppData\Local\Streamlink\pkgs\streamlink\plugins\crunchyroll.py", line 173, in _api_call
raise CrunchyrollAPIError(err_msg, err_code)
streamlink.plugin.crunchyroll.CrunchyrollAPIError: User could not be found.

# Fixed code
def _get_streams(self):
    api = self._create_api()
    match = _url_re.match(self.url)
    media_id = int(match.group("media_id"))

    try:
        # the media.stream_data field is required, no stream data is returned otherwise
        info = api.get_info(
            media_id, fields=["media.stream_data"], schema=_media_schema
        )
    except CrunchyrollAPIError as err:
        raise PluginError("Media lookup error: {0}".format(err.msg))

    if not info:
        return

    streams = {}

    # The adaptive quality stream sometimes a subset of all the other streams listed, ultra is no included
    has_adaptive = any([s["quality"] == "adaptive" for s in info["streams"]])
    if has_adaptive:
        log.debug("Loading streams from adaptive playlist")
        for stream in filter(lambda x: x["quality"] == "adaptive", info["streams"]):
            for q, s in HLSStream.parse_variant_playlist(
                self.session, stream["url"]
            ).items():
                # rename the bitrates to low, mid, or high. ultra doesn't seem to appear in the adaptive streams
                name = STREAM_NAMES.get(q, q)
                streams[name] = s

    # If there is no adaptive quality stream then parse each individual result
    for stream in info["streams"]:
        if stream["quality"] != "adaptive":
            # the video_encode_id indicates that the stream is not a variant playlist
            if "video_encode_id" in stream:
                streams[stream["quality"]] = HLSStream(self.session, stream["url"])
            else:
                # otherwise the stream url is actually a list of stream qualities
                for q, s in HLSStream.parse_variant_playlist(
                    self.session, stream["url"]
                ).items():
                    # rename the bitrates to low, mid, or high. ultra doesn't seem to appear in the adaptive streams
                    name = STREAM_NAMES.get(q, q)
                    streams[name] = s

    return streams