cubehouse / themeparks

Unofficial API for accessing ride wait times and schedules for Disneyland, Disney World, Universal Studios, and many more parks
MIT License
540 stars 126 forks source link

[ERROR][sometimes] fetch English name of Tokyo Disneyland&sea #183

Closed nicectrl closed 5 years ago

nicectrl commented 5 years ago

Park Tokyo Disneyland&sea Context

Describe the bug Sometimes, got wrong html file response as below, when fetch the html for English name of Tokyo Disneyland&sea.

I tried my hard study, but not work 100% stable.

So, can we get English name via JSON API, not by html?

Output <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

東京ディズニーリゾート・オフィシャルウェブサイト

東京ディズニーリゾートからのお知らせ

東京ディズニーリゾート・オフィシャルウェブサイトは、現在アクセスできなくなっております。
しばらく時間をおいてから、再度アクセスしていただきますようお願いいたします。

This site is temporarily unavailable.
Please try back again later.

cubehouse commented 5 years ago

There may be a JSON endpoint, but there wasn't when the integration was built. If you know of one we can change it, otherwise I guess we can server l detect the error and fall back on cached data somehow.

cubehouse commented 5 years ago

Cannot find a JSON endpoint I'm afraid. If you run the app on an English device, it will request an "en" version of the facilities, but it just returns them in Japanese anyway (the app isn't actually available on the Google Play store outside Japan, so they clearly have no intention on this being used by English speakers).

I've made some changes to fallback on a set of offline data if the HTML fails. But as long as you keep your NodeJS running, you should only be making a request for new English names once a day, so is very unlikely to happen.

nicectrl commented 5 years ago

Thank you very much for your try to request EN version via JSON endpoint. And I have already cached names one-day-long, but another day, it will do happen sometimes.