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

TypeError: 'Manga' object is not subscriptable when accessing things inside get_manga_list() #19

Closed
lasersPew opened this issue Aug 1, 2022 · 2 comments

Comments

@lasersPew
Copy link
Contributor

Describe the bug
Can't access things inside the output of get_manga_list()

To Reproduce
Steps to reproduce the behavior:

import mangadex as md
md_api = md.Api()
print(md_api.get_manga_list(title='Hyouka')[0]['id'])

Expected behavior
would return the series id.

Screenshots
image

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
  • Browser Firefox
  • Version 103.0

Additional context
Hello, I was currently planning on using this module for a bot I'm creating, I'm currently trying to access the info that get_manga_list() provides and use those on other things(getting chapter lists, getting pages, etc. basically, using the API with full automation.)

@EMACC99
Copy link
Owner

EMACC99 commented Aug 2, 2022

Hello, the problem here lies that to access the id of the manga is with .manga_id as Manga is an object and not a dictionary (that's why the error says that object is not subscriptable), so it should be something like this:

import mangadex as md
md_api = md.Api()
print(md_api.get_manga_list(title='Hyouka')[0].manga_id)

@lasersPew
Copy link
Contributor Author

Thanks. Issue fixed.

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