diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-10-03 17:28:54 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-10-03 17:28:54 +0200 |
commit | 2231da09cb51f22253512164cf31f36170a359b1 (patch) | |
tree | c8b072422dc804163141845a2f910e768b3206b1 | |
parent | ba516cdbad7c1fe7bd9a3fe662ae5c680c561bc7 (diff) |
VBN: switch to mgate (using micmac)
-rw-r--r-- | lib/Travel/Status/DE/HAFAS.pm | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index 15249d0..c77a537 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -165,10 +165,26 @@ my %hafas_instance = ( }, }, VBN => { - url => 'https://fahrplaner.vbn.de/hafas/stboard.exe', + mgate => 'https://fahrplaner.vbn.de/bin/mgate.exe', stopfinder => 'https://fahrplaner.vbn.de/hafas/ajax-getstop.exe', name => 'Verkehrsverbund Bremen/Niedersachsen', productbits => [qw[ice ice regio regio s bus ferry u tram ondemand]], + salt => 'SP31mBu' . 'fSyCLmNxp', + micmac => 1, + request => { + client => { + id => 'VBN', + v => '6000000', + type => 'IPH', + name => 'vbn', + }, + ver => '1.42', + auth => { + type => 'AID', + aid => 'kaoxIXLn' . '03zCr2KR', + }, + lang => 'deu', + }, }, ); @@ -278,7 +294,14 @@ sub new_mgate { my $url = $conf{url} // $hafas_instance{$service}{mgate}; if ( my $salt = $hafas_instance{$service}{salt} ) { - $url .= '?checksum=' . md5_hex( $self->{post} . $salt ); + if ( $hafas_instance{$service}{micmac} ) { + my $mic = md5_hex( $self->{post} ); + my $mac = md5_hex( $mic . $salt ); + $url .= "?mic=$mic&mac=$mac"; + } + else { + $url .= '?checksum=' . md5_hex( $self->{post} . $salt ); + } } if ( $conf{json} ) { |