ghoshRitesh12 / aniwatch-api

Node.js API for obtaining anime information from hianime.to (formerly aniwatch.to)
https://api-aniwatch.onrender.com
MIT License
206 stars 115 forks source link

Episode Source endpoint returns status 500 for RAW server in Hianime #42

Closed RazeViana closed 4 months ago

RazeViana commented 4 months ago

Describe the bug

When you try to call the episode source endpoint for an anime episode that only has the RAW server (on HiAnime) it returns 500 status code.

Expected behavior

Return the episode source objects.

Actual behavior

When using this server on HiAnime image

It returns status 500.

Additional context

This error occurs in newer episodes that are recently released.

WBRK-dev commented 4 months ago

What does the error message say?

RazeViana commented 4 months ago

I'm not at my pc now but it was something along the lines of "can't find server"

WBRK-dev commented 4 months ago

Which anime has the raw server? Then I can have a look at it myself. :smiley:

RazeViana commented 4 months ago

So far this one and this one

WBRK-dev commented 4 months ago

I am not getting any errors on raw servers. Are you sure you are using the latest version of the api?

RazeViana commented 4 months ago

This is the endpoint I am trying to use: https://api-aniwatch.onrender.com/anime/episode-srcs?id=konosuba-gods-blessing-on-this-wonderful-world-3-19108?ep=123214

This is the result: image

WBRK-dev commented 4 months ago

You're right! There seems to be some kind of edge case on that specific episode. I will have a look into that.

WBRK-dev commented 4 months ago

I've created a pr that should fix the problems you mentioned. #43 A fix for the current version is adding &category=raw to the /episode-srcs endpoint.

Example: https://api-aniwatch.onrender.com/anime/episode-srcs?id=konosuba-gods-blessing-on-this-wonderful-world-3-19108?ep=123214&category=raw

ghoshRitesh12 commented 4 months ago

@WBRK-dev thanks for the quick fix

RazeViana commented 4 months ago

Great thanks!

RazeViana commented 4 months ago

BTW, is it possible to make it return the anime with RAW without the query parameter 'category'? Perhaps make it fallback to that if it gets a 500 by the default flow?

WBRK-dev commented 4 months ago

No, you need to check on your end what category you want to use. The default is sub. If there is a fallback then it would take much longer to get a response.

You can always check what servers are available with the /servers endpoint.

RazeViana commented 4 months ago

okay thanks, I can close the ticket now 💯