derf / Travel-Routing-DE-VRR

CLI client for EFA-based itinerary services
http://finalrewind.org/projects/Travel-Routing-DE-VRR/
19 stars 4 forks source link

VRR API Changes #9

Open fbrinker opened 6 years ago

fbrinker commented 6 years ago

I guess VRR did change their page lately?

I've used the tool like this before: efa MS Hbf Rheine Bf

But now I get the following error message: Backend error: The name 'Bf' is ambiguous. Try one of Rheine, Mesum, Bahnhof | Rodde (Rheine), Bahnhof | Rheine, Bahnhof

But I can't solve it. Tested for example efa MS Hbf Rheine "Rheine, Bahnhof" and all other variants and it didn't work anymore. Another, similar, station works: efa MS Hbf Rheine "Mesum Bf"

Trying to force it like efa MS Hbf Rheine "Rheine Bahnhof Bahnhof" selects Eschweiler as destination :/

Any ideas? Can I use an id or something like that? Tried to analyze the request data of http://efa.vrr.de/vrr/XSLT_TRIP_REQUEST2 but with no luck or any clue.

derf commented 6 years ago

The VRR EFA uses a session-based destination selection in these cases (as in, it displays a list of alternatives, and then does not use the station name but a code specific to list and user session for the actual request). Looks like I'll have to parse the selection list, check if one of its entries is identical to the user-provided station name (i.e., EFA's ambiguity detection is misbehaving), and then automatically redo the request with appropriate session data and selection index.

Unfortunately, I don't have a workaround either.

derf commented 6 years ago

Oh wait, I do have a workaround! For whatever reason, this bug/issue is only affecting the classic VRR API. There is another one which is still working fine.

So, until I have figured out (and perhaps fixed) what's going on here, please use efa -s VRR2 ...

fbrinker commented 6 years ago

Awesome, thank you \o/ Now I can see my next trains in my polybar after work again. Thank you for your work