Skip to content

KeyError: 260 #5

@LittleApple-fp16

Description

@LittleApple-fp16

neuralcloud/character seems lead to an unexpected error, is this a bug?
It appears on any version and os, but I've only recently discovered such of this.

>>> from gchar.resources.sites import get_site_tag
>>> get_site_tag('知更鸟','danbooru')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/site-packages/gchar/resources/sites/tags.py", line 167, in get_site_tag
    tags = list_site_tags(ch, site, sure_only, with_posts, allow_fuzzy, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/gchar/resources/sites/tags.py", line 124, in list_site_tags
    tags = _get_raw_site_tags(ch, site, sure_only, allow_fuzzy, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/gchar/resources/sites/tags.py", line 76, in _get_raw_site_tags
    ch = get_character(ch, allow_fuzzy, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/gchar/games/dispatch/access.py", line 246, in get_character
    _items = list_character(name, limit=1, allow_fuzzy=allow_fuzzy, fuzzy_threshold=fuzzy_threshold,
  File "/usr/local/lib/python3.10/site-packages/gchar/games/dispatch/access.py", line 212, in list_character
    ordered = [ch for ch, _ in iterator]
  File "/usr/local/lib/python3.10/site-packages/gchar/games/dispatch/access.py", line 212, in <listcomp>
    ordered = [ch for ch, _ in iterator]
  File "/usr/local/lib/python3.10/site-packages/gchar/games/dispatch/access.py", line 147, in _yield_characters
    if any([_name == name for _name in ch._names()]):
  File "/usr/local/lib/python3.10/site-packages/gchar/games/base/character.py", line 254, in _names
    return [*self.cnnames, *self.ennames, *self.jpnames]
  File "/usr/local/lib/python3.10/site-packages/gchar/games/neuralcloud/character.py", line 33, in cnnames
    if self.gf_char:
  File "/usr/local/lib/python3.10/site-packages/gchar/games/neuralcloud/character.py", line 79, in gf_char
    return self._list_index_of_gf()[self.__raw_data["gf"]["id"]]
KeyError: 260

image
btw '雷电将军' does not raise this error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions