cubehouse / themeparks

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

ShanghaiDisneyResortMagicKingdom wait times not updating #381

Closed jtmaddux closed 2 months ago

jtmaddux commented 4 months ago

Park Which park/resort has this issue? ShanghaiDisneyResortMagicKingdom

Context

Describe the bug ShanghaiDisneyResortMagicKingdom has been returning the same wait times for rides for the last 2 weeks. For example "Dumbo the Flying Elephant" is constantly 20minutes wait (operatiing) despite the park being closed right now.

The other disney parks are reporting ok.

Output Dumbo the Flying Elephant: 20 minutes wait (Operating)

$ rm themeparks.db $ PARKID=ShanghaiDisneyResortMagicKingdom NODE_DEBUG=themeparks PRINTDATA=true node test_basic.mjs THEMEPARKS 34676: ShanghaiDisneyResortMagicKingdom: Set useragent to Opera/9.80 (Android; Opera Mini/7.5.33361/31.1543; U; en) Presto/2.8.119 Version/11.1010 THEMEPARKS 34676: Setting up database "themeparks.db" THEMEPARKS 34676: Making request to https://api.themeparks.wiki/preview/parks/ShanghaiDisneylandPark/waittime THEMEPARKS 34676: Calling get:https://api.themeparks.wiki/preview/parks/ShanghaiDisneylandPark/waittime THEMEPARKS 34676: Found 'application/json' header from in HTTP request, parsing JSON data THEMEPARKS 34676: Successfully fetched body for URL https://api.themeparks.wiki/preview/parks/ShanghaiDisneylandPark/waittime Challenge Trails at Camp Discovery: 5 minutes wait (Operating) Selfie Spot with Disney Jungle Characters : 0 minutes wait (Closed) Become Iron Man: 5 minutes wait (Operating) Selfie Spot with Mickey : 0 minutes wait (Closed) Vista Trail at Camp Discovery: null minutes wait (Operating) Selfie Spot with Spider Man: 5 minutes wait (Operating) Zootopia: Hot Pursuit: 60 minutes wait (Operating) The Many Adventures of Winnie the Pooh: 30 minutes wait (Operating) Alice in Wonderland Maze: 5 minutes wait (Operating) Buzz Lightyear Planet Rescue: 5 minutes wait (Operating) Dumbo the Flying Elephant: 20 minutes wait (Operating) Enchanted Storybook Castle: 0 minutes wait (Closed) Selfie Spot with Princesses : 0 minutes wait (Closed) Camp Discovery: null minutes wait (Operating) Explorer Canoes: 10 minutes wait (Operating) Fantasia Carousel: 5 minutes wait (Operating) Garden of the Twelve Friends: 0 minutes wait (Closed) Hunny Pot Spin: 20 minutes wait (Operating) Jet Packs: 30 minutes wait (Operating) Marvel Universe: null minutes wait (Operating) Siren's Revenge: 5 minutes wait (Operating) “Once Upon a Time” Adventure: 5 minutes wait (Operating) Rex’s Racer: 40 minutes wait (Operating) Roaring Rapids: 45 minutes wait (Operating) Seven Dwarfs Mine Train: 65 minutes wait (Operating) Shipwreck Shore: 5 minutes wait (Operating) Slinky Dog Spin: 20 minutes wait (Operating) TRON Lightcycle Power Run – Presented by Chevrolet: 30 minutes wait (Operating) TRON Realm, Chevrolet Digital Challenge: null minutes wait (Operating) Peter Pan’s Flight: 25 minutes wait (Operating) Pirates of the Caribbean Battle for the Sunken Treasure: 10 minutes wait (Operating) Soaring Over the Horizon: 50 minutes wait (Operating) Stitch Encounter: 15 minutes wait (Operating) Voyage to the Crystal Grotto: 5 minutes wait (Operating) Woody’s Roundup: 10 minutes wait (Operating)

test_basic.mjs is from the example: import Themeparks from "themeparks";

Themeparks.Settings.Cache = "themeparks.db";

const ShanghaiDisneyResortMagicKingdom = new Themeparks.Parks.ShanghaiDisneyResortMagicKingdom();

// Access wait times by Promise const CheckWaitTimes = () => { ShanghaiDisneyResortMagicKingdom.GetWaitTimes().then((rideTimes) => { rideTimes.forEach((ride) => { console.log(${ride.name}: ${ride.waitTime} minutes wait (${ride.status})); }); }).catch((error) => { console.error(error); }).then(() => { setTimeout(CheckWaitTimes, 1000 60 5); // refresh every 5 minutes }); }; CheckWaitTimes();

cubehouse commented 4 months ago

Hi there,

Thanks for the issue report, this is a known issue. The Shanghai app has changed and I have not yet had an opportunity to update the backend to work with their new implementation.

jtmaddux commented 4 months ago

they appear to be using SHDR_R and SHDR_V headers, without which it returns 402 error and { "error": "Config is invalid.", "error_description": "Config is invalid." }

oh I found the discord and see you already discussing this there :-)

cubehouse commented 4 months ago

The headers are generated within the app, which will require reverse engineering to understand the algorithm and any secret keys required to build.

api.themeparks.wiki is running with wait times for Shanghai now, but the solution is temporary and not part of this codebase.