juliuste / bahn.guru

Deutsche Bahn ticket price calendar.
https://bahn.guru
ISC License
373 stars 22 forks source link

Links to connections don't work anymore. #32

Open zwogorg opened 2 years ago

zwogorg commented 2 years ago

Hi! It seems that the links directing to the Deutsche Bahn website don't work anymore. I think they changed the booking website on the first of April and now deeplinks are dead/redirect to the booking portal.

juliuste commented 2 years ago

bahn.guru uses generate-db-shop-urls to generate these links, so this library needs to be adapted to the latest bahn.de markup.

MartinLangbecker commented 2 years ago

generate-db-shop-urls was just updated and should now support the latest bahn.de layout.

derhuerst commented 2 years ago

Not sure if it works in enough cases though, while testing it, I encountered several cases where it couldn't match a journey.

tech-nickel commented 2 years ago

Problem still exists. Just tested the connection from Stuttgart Hbf to Heidelberg Hbf, no redirects worked for me. I had to manually search for the connection in the "Rieseauskunft".

derhuerst commented 2 years ago

@tech-nickel Can you provide a connection that it fails with? Ideally a few days or weeks from now, so that we have some time to debug this before it's affected by realtime changes.

juliuste commented 2 years ago

@derhuerst bahn.guru still uses the old version of generate-db-shop-urls, so all connections fail (meaning that providing an example probably won't help you 😄)

Lamdarer commented 1 year ago

Any news on this? Would be great to have it working again.

derhuerst commented 1 year ago

Just checked, with an example connection, and generate-db-shop-urls@4.0.0 successfully generated a booking URL for it.

So I assume upgrading generate-db-shop-urls solves the issue. I couldn't find it in this repo though.

juliuste commented 1 year ago

I upgraded generate-db-shop-urls in link.bahn.guru now. I tried some connections, seems to work, but feel free to test as well and let me know. Thanks @derhuerst for the work!

tech-nickel commented 1 year ago

Seems to work for me as well. Thank you!

Lamdarer commented 1 year ago

Also quickly tested it, most seem to work, though upon further testing this one doesnt seem to work (I searched for "Hannover Hbf → München Hbf", "max. 3 Umstiege" and selected the 24.12.2022, "22:36-06:04 Uhr" over "Göttingen" with "ICE, ME" for 44,90€). EDIT: Also tried "Hamburg Hbf → Berlin Hbf 30.12.2022" "23:33 to 05:35 Uhr" again ICE and ME, it is also broken(so there might be a problem with the MEs).

Maybe someone can have a look at this, but with most links working it's already a huge improvement, thx.

juliuste commented 1 year ago

Thanks for the example, I remember that "private" trains always had some problems (like Metronom in this example), but maybe @derhuerst can look into that?

derhuerst commented 1 year ago

@Lamdarer Please report such issues in the generate-db-shop-urls repo, so that I can keep track of them. Also, if possible, please include the following, so that I can try to pinpoint the problem even in hindsight, as often the data in the DB website changes:

mkg20001 commented 1 year ago

I've made a PR on link.bahn.guru to use the new search to link to the search page with the first result being the connection (this isn't perfect but it's pretty great. I'd be open to also just using this as a fallback link it's now just the fallback link)

https://github.com/juliuste/link.bahn.guru/pull/2