TheEnigmaBlade / holo

Episode discussion bot for /r/anime.
https://reddit.com/r/anime
MIT License
82 stars 24 forks source link

FUNimation API no longer updated #5

Open OussamaDanba opened 8 years ago

OussamaDanba commented 8 years ago

The FUNimation API stopped getting updated on March 14th presumably because all old applications were phased out in favor of new ones with the FunimationNow branding. These new applications use a completely different API which is shared among multiple device types (instead of a separate API for every device). Both the FUNimation PlayStation API and mobile API are no longer updated with new episodes (not sure about other ones).

There is a small chance that this happened because of the DST change since the old APIs are still online but no longer reporting new information. I personally doubt it since about a day after the DST change new data was added.

clemens-schulz commented 8 years ago

I'll just leave this here: https://api-funimation.dadcdigital.com/xml/longlist/content/page/?id=shows&sort=&title=All%2520Shows&sort_direction=DESC&role=g&itemThemes=dateAddedShow&territory=US&offset=0&limit=20

clemens-schulz commented 8 years ago

I would suggest writing a web scraping script instead of using the new API. It doesn't even return all new episodes when you log in with an All-Access Account. Web scraping will break in a few month, but it might be more reliable in the long run. The new API is basically a website, too.

TheEnigmaBlade commented 8 years ago

That particular end point is returning a list of available shows, so it only returns minimal information for the most recent episode.

There might be another value for id to return available episodes for a specific show, but I don't have a device I can use to get that information.

clemens-schulz commented 8 years ago

@TheEnigmaBlade There are other endpoint. But it seems like you cannot access them without logging in. (Or using special session headers, I didn't have time to check.) Even if you log in, it won't return subscriber episodes (even if you're a subscriber). Until that's fixed it's basically useless.

I just want to point out, that there is no upside to using the new API, because it's not really a data API. Responses also contain navigation and layout information which might change at any time. The website, on the other hand, doesn't require login and is never stale.

OussamaDanba commented 8 years ago

Something that should be noted if web scraping is used is that somewhere in May the entire FUNimation website will get a redesign meaning you'd have to do double work.

TheEnigmaBlade commented 8 years ago

the entire FUNimation website will get a redesign

This is why I'm trying to avoid web scraping as much as possible.

I just commited (f203ded6c541a73688cd9f64b750cd76be36bd3f) runnable but not very nice support for the new feed. Access to the most recent episode is all that's needed, but it negatively affects some features requiring non-returned information, like episode name and URL.

clemens-schulz commented 8 years ago

@Shadoxfix No, no, they announced May! So not before the end of June... :P

I don't think the redesign will require a lot of changes to a web scraper. Probably just some url and regex changes. (Best case.)

@TheEnigmaBlade You could use both, API and scraper, at the same time and use whatever doesn't break. Might be a good idea to prevent downtime in the future. I can implement it and send you a pull request, if you're interested.

TheEnigmaBlade commented 8 years ago

@clemens-schulz Feel free to submit a pull request at any time. I'm not against the idea (MAL support scrapes the site because their API is :hankey:), but I prefer to use a source likely to be more stable whenever possible.

OussamaDanba commented 8 years ago

The PlayStation API just got updated with new episodes (Akagami no Shirayuki-hime e.g.). Seems like it might not be deprecated just yet. Although it does seem to be delayed quite a bit.