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

[Fix] Character's pictures Request returns the pictures twice #98

Closed
ym496 opened this issue Aug 9, 2021 · 1 comment
Closed

[Fix] Character's pictures Request returns the pictures twice #98

ym496 opened this issue Aug 9, 2021 · 1 comment

Comments

@ym496
Copy link

ym496 commented Aug 9, 2021

Let's say I want to search for the pictures of a character with user id say 180844

from jikanpy import Jikan
characterid = 180844
jikan = Jikan()
output = jikan.character(characterid,'pictures')

On mal this character has two images so it should return two large and two short images but the output is something like:

{'pictures': [{'large': 'https://cdn.myanimelist.net/images/characters/3/405871.jpg', 'small':
'https://cdn.myanimelist.net/images/characters/3/405871.jpg'}, {'large':
'https://cdn.myanimelist.net/images/characters/6/417850.jpg', 'small':
'https://cdn.myanimelist.net/images/characters/6/417850.jpg'}, {'large':
'https://cdn.myanimelist.net/images/characters/3/405871.jpg', 'small':
'https://cdn.myanimelist.net/images/characters/3/405871.jpg'}, {'large':
'https://cdn.myanimelist.net/images/characters/6/417850.jpg', 'small':
'https://cdn.myanimelist.net/images/characters/6/417850.jpg'}]}

Basically the latter images are same as the starting ones.

@abhinavk99
Copy link
Owner

What JikanPy is doing in this case is making an API request to https://api.jikan.moe/v3/character/180844/pictures and returning the JSON. If you open the link in your browser you should see something like:

{
  "request_hash": "request:character:5aa427c33cbddee4bfdea968e915ed3ddb1034d3",
  "request_cached": true,
  "request_cache_expiry": 46809,
  "pictures": [
    {
      "large": "https://cdn.myanimelist.net/images/characters/3/405871.jpg",
      "small": "https://cdn.myanimelist.net/images/characters/3/405871.jpg"
    },
    {
      "large": "https://cdn.myanimelist.net/images/characters/6/417850.jpg",
      "small": "https://cdn.myanimelist.net/images/characters/6/417850.jpg"
    },
    {
      "large": "https://cdn.myanimelist.net/images/characters/3/405871.jpg",
      "small": "https://cdn.myanimelist.net/images/characters/3/405871.jpg"
    },
    {
      "large": "https://cdn.myanimelist.net/images/characters/6/417850.jpg",
      "small": "https://cdn.myanimelist.net/images/characters/6/417850.jpg"
    }
  ]
}

Since the API response JSON looks like this, this seems to be an issue with the Jikan API, not JikanPy, so I recommend you create an issue at https://github.com/jikan-me/jikan. Sorry I couldn't help more.

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