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

Upgrade EuropaPark API Version #147

Closed senorihl closed 5 years ago

senorihl commented 5 years ago

Park EuropaPark

Context

Describe the bug I ran this test :

NODE_DEBUG=themeparks PARKID=EuropaPark npm run testonline

And went through multiple test failing, so i tested online with a changed api version and it worked : https://api.europapark.de/api-5.5/pointsofinterest

Output


> themeparks@4.7.14 testonline /home/senorihl/code/cubehouse/themeparks
> mocha lib/testonline.js

THEMEPARKS 29268: EuropaPark: Set useragent to okhttp/2.7.0

  Park EuropaPark
    Get Park Wait Times
THEMEPARKS 29268: Making request to https://api.europapark.de/api-5.4/pointsofinterest
THEMEPARKS 29268: Calling get:https://api.europapark.de/api-5.4/pointsofinterest
THEMEPARKS 29268: Network request failed attempt 0/3 for URL https://api.europapark.de/api-5.4/pointsofinterest
THEMEPARKS 29268: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access /api-5.4/pointsofinterest\non this server.<br />\n</p>\n<hr>\n<address>Apache/2.4.25 (Debian) Server at api.europapark.de Port 443</address>\n</body></html>\n"
THEMEPARKS 29268: Calling get:https://api.europapark.de/api-5.4/pointsofinterest
THEMEPARKS 29268: Network request failed attempt 1/3 for URL https://api.europapark.de/api-5.4/pointsofinterest
THEMEPARKS 29268: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access /api-5.4/pointsofinterest\non this server.<br />\n</p>\n<hr>\n<address>Apache/2.4.25 (Debian) Server at api.europapark.de Port 443</address>\n</body></html>\n"
THEMEPARKS 29268: Calling get:https://api.europapark.de/api-5.4/pointsofinterest
THEMEPARKS 29268: Network request failed attempt 2/3 for URL https://api.europapark.de/api-5.4/pointsofinterest
THEMEPARKS 29268: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access /api-5.4/pointsofinterest\non this server.<br />\n</p>\n<hr>\n<address>Apache/2.4.25 (Debian) Server at api.europapark.de Port 443</address>\n</body></html>\n"
      1) should not return an error fetching ride times
      2) should have some ride data
      3) should have an ID for every ride
      4) should have a wait time for every ride
      5) should have a name for every ride
      6) should have an active state for every ride
      7) should have a fastpass field for every ride
      8) should have a status field for every ride
      9) should have matching status and active fields
    Get Schedule
THEMEPARKS 29268: Making request to https://api.europapark.de/api-5.4/openingtimes
THEMEPARKS 29268: Calling get:https://api.europapark.de/api-5.4/openingtimes
THEMEPARKS 29268: Network request failed attempt 0/3 for URL https://api.europapark.de/api-5.4/openingtimes
THEMEPARKS 29268: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access /api-5.4/openingtimes\non this server.<br />\n</p>\n<hr>\n<address>Apache/2.4.25 (Debian) Server at api.europapark.de Port 443</address>\n</body></html>\n"
THEMEPARKS 29268: Calling get:https://api.europapark.de/api-5.4/openingtimes
THEMEPARKS 29268: Network request failed attempt 1/3 for URL https://api.europapark.de/api-5.4/openingtimes
THEMEPARKS 29268: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access /api-5.4/openingtimes\non this server.<br />\n</p>\n<hr>\n<address>Apache/2.4.25 (Debian) Server at api.europapark.de Port 443</address>\n</body></html>\n"
THEMEPARKS 29268: Calling get:https://api.europapark.de/api-5.4/openingtimes
THEMEPARKS 29268: Network request failed attempt 2/3 for URL https://api.europapark.de/api-5.4/openingtimes
THEMEPARKS 29268: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access /api-5.4/openingtimes\non this server.<br />\n</p>\n<hr>\n<address>Apache/2.4.25 (Debian) Server at api.europapark.de Port 443</address>\n</body></html>\n"
      10) should not error when fetching schedule
      11) should have schedule data
      ✓ should have a valid date for each schedule entry
      ✓ should have a valid opening time for each schedule entry
      ✓ should have a valid closing time for each schedule entry

  3 passing (9s)
  11 failing

  1) Park EuropaPark
       Get Park Wait Times
         should not return an error fetching ride times:

      Uncaught AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  assert(!err)

      + expected - actual

      -false
      +true

      at /home/senorihl/code/cubehouse/themeparks/lib/testonline.js:26:17
      at EuropaPark.<anonymous> (lib/park.js:155:17)
      at tryCatcher (node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (node_modules/bluebird/js/release/promise.js:512:31)
      at Promise._settlePromise (node_modules/bluebird/js/release/promise.js:569:18)
      at Promise._settlePromise0 (node_modules/bluebird/js/release/promise.js:614:10)
      at Promise._settlePromises (node_modules/bluebird/js/release/promise.js:689:18)
      at Async._drainQueue (node_modules/bluebird/js/release/async.js:133:16)
      at Async._drainQueues (node_modules/bluebird/js/release/async.js:143:10)
      at Immediate.Async.drainQueues [as _onImmediate] (node_modules/bluebird/js/release/async.js:17:14)

  2) Park EuropaPark
       Get Park Wait Times
         should have some ride data:
     AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  assert(times)

      at Context.<anonymous> (lib/testonline.js:32:13)

  3) Park EuropaPark
       Get Park Wait Times
         should have an ID for every ride:
     TypeError: Cannot read property '0' of undefined
      at Context.<anonymous> (lib/testonline.js:41:47)

  4) Park EuropaPark
       Get Park Wait Times
         should have a wait time for every ride:
     TypeError: Cannot read property '0' of undefined
      at Context.<anonymous> (lib/testonline.js:45:47)

  5) Park EuropaPark
       Get Park Wait Times
         should have a name for every ride:
     TypeError: Cannot read property '0' of undefined
      at Context.<anonymous> (lib/testonline.js:49:47)

  6) Park EuropaPark
       Get Park Wait Times
         should have an active state for every ride:
     TypeError: Cannot read property '0' of undefined
      at Context.<anonymous> (lib/testonline.js:53:47)

  7) Park EuropaPark
       Get Park Wait Times
         should have a fastpass field for every ride:
     TypeError: Cannot read property '0' of undefined
      at Context.<anonymous> (lib/testonline.js:57:47)

  8) Park EuropaPark
       Get Park Wait Times
         should have a status field for every ride:
     TypeError: Cannot read property '0' of undefined
      at Context.<anonymous> (lib/testonline.js:68:47)

  9) Park EuropaPark
       Get Park Wait Times
         should have matching status and active fields:
     TypeError: Cannot read property '0' of undefined
      at Context.<anonymous> (lib/testonline.js:79:47)

  10) Park EuropaPark
       Get Schedule
         should not error when fetching schedule:

      Uncaught AssertionError [ERR_ASSERTION]: GetOpeningTimes returned an error: Error fetching park opening times: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access /api-5.4/openingtimes\non this server.<br />\n</p>\n<hr>\n<address>Apache/2.4.25 (Debian) Server at api.europapark.de Port 443</address>\n</body></html>\n"
      + expected - actual

      -false
      +true

      at /home/senorihl/code/cubehouse/themeparks/lib/testonline.js:95:17
      at EuropaPark.<anonymous> (lib/park.js:308:17)
      at tryCatcher (node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (node_modules/bluebird/js/release/promise.js:512:31)
      at Promise._settlePromise (node_modules/bluebird/js/release/promise.js:569:18)
      at Promise._settlePromise0 (node_modules/bluebird/js/release/promise.js:614:10)
      at Promise._settlePromises (node_modules/bluebird/js/release/promise.js:689:18)
      at Async._drainQueue (node_modules/bluebird/js/release/async.js:133:16)
      at Async._drainQueues (node_modules/bluebird/js/release/async.js:143:10)
      at Immediate.Async.drainQueues [as _onImmediate] (node_modules/bluebird/js/release/async.js:17:14)

  11) Park EuropaPark
       Get Schedule
         should have schedule data:

      AssertionError [ERR_ASSERTION]: Should be at least 4 schedule items. Found 0
      + expected - actual

      -false
      +true

      at Context.<anonymous> (lib/testonline.js:107:13)

npm ERR! code ELIFECYCLE
npm ERR! errno 11
npm ERR! themeparks@4.7.14 testonline: `mocha lib/testonline.js`
npm ERR! Exit status 11
npm ERR! 
npm ERR! Failed at the themeparks@4.7.14 testonline script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/senorihl/.npm/_logs/2019-04-07T11_32_35_556Z-debug.log
LouisForaux commented 5 years ago

Hey!

For fixing this, replace 5.4 by 5.6 in the URL! And pull on Github changes, normally, it will working by change 4 to 6!

Good day, Louis

Le dim. 7 avr. 2019 à 13:33, Rodolphe Renaux notifications@github.com a écrit :

Park EuropaPark

Context

Describe the bug I ran this test :

NODE_DEBUG=themeparks PARKID=EuropaPark npm run testonline

And went through multiple test failing, so i tested online with a changed api version and it worked : https://api.europapark.de/api-5.5/pointsofinterest

Output

themeparks@4.7.14 testonline /home/senorihl/code/cubehouse/themeparks

mocha lib/testonline.js

THEMEPARKS 29268: EuropaPark: Set useragent to okhttp/2.7.0

Park EuropaPark

Get Park Wait Times

THEMEPARKS 29268: Making request to https://api.europapark.de/api-5.4/pointsofinterest

THEMEPARKS 29268: Calling get:https://api.europapark.de/api-5.4/pointsofinterest

THEMEPARKS 29268: Network request failed attempt 0/3 for URL https://api.europapark.de/api-5.4/pointsofinterest

THEMEPARKS 29268: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n\n403 Forbidden\n\n

Forbidden

\n

You don't have permission to access /api-5.4/pointsofinterest\non this server.
\n

\n
\n
Apache/2.4.25 (Debian) Server at api.europapark.de Port 443
\n\n"

THEMEPARKS 29268: Calling get:https://api.europapark.de/api-5.4/pointsofinterest

THEMEPARKS 29268: Network request failed attempt 1/3 for URL https://api.europapark.de/api-5.4/pointsofinterest

THEMEPARKS 29268: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n\n403 Forbidden\n\n

Forbidden

\n

You don't have permission to access /api-5.4/pointsofinterest\non this server.
\n

\n
\n
Apache/2.4.25 (Debian) Server at api.europapark.de Port 443
\n\n"

THEMEPARKS 29268: Calling get:https://api.europapark.de/api-5.4/pointsofinterest

THEMEPARKS 29268: Network request failed attempt 2/3 for URL https://api.europapark.de/api-5.4/pointsofinterest

THEMEPARKS 29268: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n\n403 Forbidden\n\n

Forbidden

\n

You don't have permission to access /api-5.4/pointsofinterest\non this server.
\n

\n
\n
Apache/2.4.25 (Debian) Server at api.europapark.de Port 443
\n\n"

  1) should not return an error fetching ride times

  2) should have some ride data

  3) should have an ID for every ride

  4) should have a wait time for every ride

  5) should have a name for every ride

  6) should have an active state for every ride

  7) should have a fastpass field for every ride

  8) should have a status field for every ride

  9) should have matching status and active fields

Get Schedule

THEMEPARKS 29268: Making request to https://api.europapark.de/api-5.4/openingtimes

THEMEPARKS 29268: Calling get:https://api.europapark.de/api-5.4/openingtimes

THEMEPARKS 29268: Network request failed attempt 0/3 for URL https://api.europapark.de/api-5.4/openingtimes

THEMEPARKS 29268: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n\n403 Forbidden\n\n

Forbidden

\n

You don't have permission to access /api-5.4/openingtimes\non this server.
\n

\n
\n
Apache/2.4.25 (Debian) Server at api.europapark.de Port 443
\n\n"

THEMEPARKS 29268: Calling get:https://api.europapark.de/api-5.4/openingtimes

THEMEPARKS 29268: Network request failed attempt 1/3 for URL https://api.europapark.de/api-5.4/openingtimes

THEMEPARKS 29268: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n\n403 Forbidden\n\n

Forbidden

\n

You don't have permission to access /api-5.4/openingtimes\non this server.
\n

\n
\n
Apache/2.4.25 (Debian) Server at api.europapark.de Port 443
\n\n"

THEMEPARKS 29268: Calling get:https://api.europapark.de/api-5.4/openingtimes

THEMEPARKS 29268: Network request failed attempt 2/3 for URL https://api.europapark.de/api-5.4/openingtimes

THEMEPARKS 29268: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n\n403 Forbidden\n\n

Forbidden

\n

You don't have permission to access /api-5.4/openingtimes\non this server.
\n

\n
\n
Apache/2.4.25 (Debian) Server at api.europapark.de Port 443
\n\n"

  10) should not error when fetching schedule

  11) should have schedule data

  ✓ should have a valid date for each schedule entry

  ✓ should have a valid opening time for each schedule entry

  ✓ should have a valid closing time for each schedule entry

3 passing (9s)

11 failing

1) Park EuropaPark

   Get Park Wait Times

     should not return an error fetching ride times:

  Uncaught AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

assert(!err)

  + expected - actual

  -false

  +true

  at /home/senorihl/code/cubehouse/themeparks/lib/testonline.js:26:17

  at EuropaPark.<anonymous> (lib/park.js:155:17)

  at tryCatcher (node_modules/bluebird/js/release/util.js:16:23)

  at Promise._settlePromiseFromHandler (node_modules/bluebird/js/release/promise.js:512:31)

  at Promise._settlePromise (node_modules/bluebird/js/release/promise.js:569:18)

  at Promise._settlePromise0 (node_modules/bluebird/js/release/promise.js:614:10)

  at Promise._settlePromises (node_modules/bluebird/js/release/promise.js:689:18)

  at Async._drainQueue (node_modules/bluebird/js/release/async.js:133:16)

  at Async._drainQueues (node_modules/bluebird/js/release/async.js:143:10)

  at Immediate.Async.drainQueues [as _onImmediate] (node_modules/bluebird/js/release/async.js:17:14)

2) Park EuropaPark

   Get Park Wait Times

     should have some ride data:

 AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

assert(times)

  at Context.<anonymous> (lib/testonline.js:32:13)

3) Park EuropaPark

   Get Park Wait Times

     should have an ID for every ride:

 TypeError: Cannot read property '0' of undefined

  at Context.<anonymous> (lib/testonline.js:41:47)

4) Park EuropaPark

   Get Park Wait Times

     should have a wait time for every ride:

 TypeError: Cannot read property '0' of undefined

  at Context.<anonymous> (lib/testonline.js:45:47)

5) Park EuropaPark

   Get Park Wait Times

     should have a name for every ride:

 TypeError: Cannot read property '0' of undefined

  at Context.<anonymous> (lib/testonline.js:49:47)

6) Park EuropaPark

   Get Park Wait Times

     should have an active state for every ride:

 TypeError: Cannot read property '0' of undefined

  at Context.<anonymous> (lib/testonline.js:53:47)

7) Park EuropaPark

   Get Park Wait Times

     should have a fastpass field for every ride:

 TypeError: Cannot read property '0' of undefined

  at Context.<anonymous> (lib/testonline.js:57:47)

8) Park EuropaPark

   Get Park Wait Times

     should have a status field for every ride:

 TypeError: Cannot read property '0' of undefined

  at Context.<anonymous> (lib/testonline.js:68:47)

9) Park EuropaPark

   Get Park Wait Times

     should have matching status and active fields:

 TypeError: Cannot read property '0' of undefined

  at Context.<anonymous> (lib/testonline.js:79:47)

10) Park EuropaPark

   Get Schedule

     should not error when fetching schedule:

  Uncaught AssertionError [ERR_ASSERTION]: GetOpeningTimes returned an error: Error fetching park opening times: 403: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access /api-5.4/openingtimes\non this server.<br />\n</p>\n<hr>\n<address>Apache/2.4.25 (Debian) Server at api.europapark.de Port 443</address>\n</body></html>\n"

  + expected - actual

  -false

  +true

  at /home/senorihl/code/cubehouse/themeparks/lib/testonline.js:95:17

  at EuropaPark.<anonymous> (lib/park.js:308:17)

  at tryCatcher (node_modules/bluebird/js/release/util.js:16:23)

  at Promise._settlePromiseFromHandler (node_modules/bluebird/js/release/promise.js:512:31)

  at Promise._settlePromise (node_modules/bluebird/js/release/promise.js:569:18)

  at Promise._settlePromise0 (node_modules/bluebird/js/release/promise.js:614:10)

  at Promise._settlePromises (node_modules/bluebird/js/release/promise.js:689:18)

  at Async._drainQueue (node_modules/bluebird/js/release/async.js:133:16)

  at Async._drainQueues (node_modules/bluebird/js/release/async.js:143:10)

  at Immediate.Async.drainQueues [as _onImmediate] (node_modules/bluebird/js/release/async.js:17:14)

11) Park EuropaPark

   Get Schedule

     should have schedule data:

  AssertionError [ERR_ASSERTION]: Should be at least 4 schedule items. Found 0

  + expected - actual

  -false

  +true

  at Context.<anonymous> (lib/testonline.js:107:13)

npm ERR! code ELIFECYCLE

npm ERR! errno 11

npm ERR! themeparks@4.7.14 testonline: mocha lib/testonline.js

npm ERR! Exit status 11

npm ERR!

npm ERR! Failed at the themeparks@4.7.14 testonline script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR! /home/senorihl/.npm/_logs/2019-04-07T11_32_35_556Z-debug.log

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cubehouse/themeparks/issues/147, or mute the thread https://github.com/notifications/unsubscribe-auth/ANp39MZbz3l1tjzu36aqAgGK8eVl9HPYks5vedeRgaJpZM4cgtQV .

cubehouse commented 5 years ago

I'll merge the pull request later and publish, but for now you can either grab source or pass "api_version": "api-5.6" in the constructor.

cubehouse commented 5 years ago

Fixed and merged with #148