Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error setting addon, possibly related to logo. #14

Open
TwigGlenn4 opened this issue Nov 23, 2022 · 1 comment
Open

Error setting addon, possibly related to logo. #14

TwigGlenn4 opened this issue Nov 23, 2022 · 1 comment

Comments

@TwigGlenn4
Copy link

This particular minecraft mod Hostile Neural Networks produces an error when it is created.
Code copied and tested from Advik-B's issue because their program let me find this issue.

from cursepy import CurseClient
from v import api_key

c = CurseClient(api_key)
game = c.game(432) # Minecraft
addon = c.addon(552574) # Hostile Neural Networks

My error is as follows and seems to imply it could be related to the mod's logo data.

Traceback (most recent call last):
  File "/home/twigglenn4/Downloads/curseTest/test.py", line 6, in <module>
    addon = c.addon(552574) # Hostile Neural Networks
  File "/home/twigglenn4/Downloads/curseTest/cursepy/wrapper.py", line 124, in addon
    return self.handle(5, addon_id)
  File "/home/twigglenn4/Downloads/curseTest/cursepy/handlers/base.py", line 990, in handle
    inst = hand.handle(*args, **kwargs)
  File "/home/twigglenn4/Downloads/curseTest/cursepy/handlers/base.py", line 411, in handle
    return super().handle()
  File "/home/twigglenn4/Downloads/curseTest/cursepy/handlers/base.py", line 190, in handle
    data = self.format(raw_data)
  File "/home/twigglenn4/Downloads/curseTest/cursepy/handlers/metacf.py", line 316, in format
    logo = base.CurseAttachment(logoa['title'], logoa['id'], logoa['thumbnailUrl'] if 'thumbnailUrl' in logoa.keys() else logoa['thumbnailurl'], logoa['url'], True, data['id'], logoa['description'])
TypeError: 'NoneType' object is not subscriptable
@OwenCochell
Copy link
Owner

OwenCochell commented Nov 25, 2022

Thanks for reporting this!

The issue was the addon you were trying to work with did not have a logo, as you suggested. If this is the case, then cursepy will skip that part when loading the addon. This should be fixed in the latest version of cursepy, the version you want is 2.2.0. Please let me know if any more issues arise, but otherwise we can close this issue.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants