Tch1b0 / dsbmobile.js

A Javascript package for the DSBmobile API
https://tch1b0.github.io/dsbmobile.js/
MIT License
5 stars 0 forks source link

Service Unavailable (503) #49

Closed blockiyt closed 1 year ago

blockiyt commented 1 year ago

Hi, I have used this API for a while, made my own fork of it, and sometimes I am getting the error "Service Unavailable (503)", but I cannot say why, because I never got one with an older JS libary for fetching DSB. I already called Heineking Media and asked them about this error, but they said that this error could not be possible. I am thinking that their services are checking the UserAgent, to check if their app is requesting, or something else. Does anyone else also experienced this, and could someone help me? Thanks!

Tch1b0 commented 1 year ago

Hey @blockiyt, you're right, that error looks really odd, as the API seems to block the request or has some internal issues. The part of the code that is requesting the data should be pretty much the same between this repo and your fork, but I've never experienced something similar.

Do you know which request fails exactly? On what platform does this error occur (browser/node.js/mobile)? And how frequently do you experience these issues?

blockiyt commented 1 year ago

https://just-paste.it/AJzJiyhCHy thats the log I get on the server when requesting from an device. What's also weird, is that when this error happens, the plans in the official DSBMobile APP also show the 503, but when you reload, they show back up as normal, but that was not everytime, just sometimes.

I think it is the request to get the plans from the api, not auth or something but I'll double check it. I cannot say how frequently, sometimes it happens, sometimes it works, I don't really know.

What about a Discord or Zoom call, there I could show you these things a little bit easier, and also talk german, because my English is not that good. Afterwards, I would sum up our talk and would post a solution if one is present.

EDIT: It's failing here: https://github.com/jcrg-hof/dsbmobile.js/blob/master/src/dsbmobile.ts#L120

Tch1b0 commented 1 year ago

Meeting up on Discord sounds good.

blockiyt commented 1 year ago

It seems that the error just magically fixed itself, I don't know why but I am quite happy!