Skip to content

List index out of range #4

Open
@kotaruTWK

Description

I cant seem to figure out the exact reason it occurs but some search terms result in a "list index out of range".
im using this with a discord bot and so far everything is working except for a few random searches like searching safebooru for "rem" or rule34 for "princess_rosalina". (Both of these searches work on the actual site itself.
exact error:
`[2022-10-08 20:08:46] [ERROR ] discord.client: Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python310\lib\site-packages\booru\client\safebooru.py", line 139, in search
return better_object(self.not_random[randint(0, len(self.not_random))])
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 409, in _run_event
await coro(*args, **kwargs)
File "C:\Users\xxxxx\Downloads\Python programs\waifu.py", line 109, in on_message
res = await imgs.search(query=content, random=True, gacha=True)
File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python310\lib\site-packages\booru\client\safebooru.py", line 148, in search
raise ValueError(f"Failed to get data: {e}")
ValueError: Failed to get data: list index out of range`

  • OS: windows 11
  • Python: 3.10.7

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions