Jintaku / Jintaku-Cogs-V3

V3 Cogs made by the Jintaku community
GNU Affero General Public License v3.0
39 stars 40 forks source link

[Error][Booru]Exception in command booru while used with tags #28

Closed BeastCore closed 4 years ago

BeastCore commented 4 years ago

A few weeks ago booru cog started having difficulty with working properly. [p]booru command works fine, however if I try to type [p]booru [tag] it throws error: "Error in command 'booru'. Check your console or logs for details."

Red version: 3.3.10 (but it stopped working even before upgrading from 3.3.8) Error is still present even after reinstalling cog.

Exception in command 'booru'. Traceback (most recent call last): File "/home/user/.pyenv/versions/vm/lib/python3.8/site-packages/discord/ext/commands/core.py", line 83, in wrapped ret = await coro(*args, kwargs) File "/home/user/.local/share/Red-DiscordBot/data/Sistine/cogs/CogManager/cogs/booru/booru.py", line 54, in booru await self.generic_booru(ctx, tag) File "/home/user/.local/share/Red-DiscordBot/data/Sistine/cogs/CogManager/cogs/booru/boorucore.py", line 77, in generic_booru alldata = await asyncio.gather(*(getattr(self, f"fetch{board}")(ctx, tag) for board in boards)) File "/home/user/.local/share/Red-DiscordBot/data/Sistine/cogs/Downloader/lib/aiocache/decorators.py", line 85, in wrapper return await self.decorator(f, *args, kwargs) File "/home/user/.local/share/Red-DiscordBot/data/Sistine/cogs/Downloader/lib/aiocache/decorators.py", line 98, in decorator result = await f(*args, **kwargs) File "/home/user/.local/share/Red-DiscordBot/data/Sistine/cogs/CogManager/cogs/booru/boorucore.py", line 945, in fetch_dan return await self.fetch_from_booru(urlstr, "Danbooru") File "/home/user/.local/share/Red-DiscordBot/data/Sistine/cogs/CogManager/cogs/booru/boorucore.py", line 903, in fetch_from_booru item["post_link"] = "[censored_danbooru_link]" + str(item["id"]) KeyError: 'id'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/user/.pyenv/versions/vm/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke await ctx.command.invoke(ctx) File "/home/user/.pyenv/versions/vm/lib/python3.8/site-packages/discord/ext/commands/core.py", line 797, in invoke await injected(*ctx.args, **ctx.kwargs) File "/home/user/.pyenv/versions/vm/lib/python3.8/site-packages/discord/ext/commands/core.py", line 92, in wrapped raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'id'

lionirdeadman commented 4 years ago

This is actually just a danbooru bug, fixed.