mfdz / GTFS-Issues

Documentation and Tracking of Issues in GTFS- and GTFS-RT Feeds
35 stars 3 forks source link

DELFI: Keine Bereitstellung unter permanenter URL #31

Open hbruch opened 4 years ago

hbruch commented 4 years ago

Art der Abweichung Entgegen der GTFS Best Practices bietet das OpenData-Portal den nationalen GTFS-Feed stets unter einer neuen URL an, nicht unter einer permanenten, zur automatisierten Aktualisierung nutzbaren URL.

Referenz http://gtfs.org/best-practices/#dataset-publishing--general-practices

Aktualisierungszeitpunkt der GTFS-Daten

  1. April 2020

Downloadlink der GTFS-Daten https://cms.opendata-oepnv.de/fileadmin/datasets/delfi/20200401_fahrplaene_gesamtdeutschland_gtfs.zip

derhuerst commented 4 years ago

Toll wäre beides: Eine permanente, stabile URL für jede Version des Datensatzes (z.b. https://static.opendata-oepnv.de/delfi/gtfs-2020-04-01.zip), sowie eine für den jeweils aktuellsten Datensatz (z.b. https://static.opendata-oepnv.de/delfi/gtfs-latest.zip).

derhuerst commented 4 years ago

von https://github.com/mfdz/GTFS-Issues/issues/29#issuecomment-599261012:

Bei Einrichtung der permanenten URL sollte zudem darauf geachtet werden, dass der Server die Abfragemethode HEAD zum reinen Abruf von Headern unterstützt [...], so dass abrufende Anwendungen feststellen können, ob sich die Daten serverseitig geändert haben und in der Folge heruntergeladen werden müssen.

Dies is beim DELFI-Datensatz aktuell nicht der Fall, der Server antwortet mit 200 OK und der vollen Content-Length: 261613986, schließt dann aber die Verbindung:

curl 'https://cms.opendata-oepnv.de/fileadmin/datasets/delfi/20200401_fahrplaene_gesamtdeutschland_gtfs.zip' -X HEAD -v >/dev/null
Warning: Setting custom HTTP method to HEAD with -X/--request may not work the 
Warning: way you want. Consider using -I/--head instead.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 109.75.188.38:443...
* Connected to cms.opendata-oepnv.de (109.75.188.38) port 443 (#0)
* ALPN, offering http/1.1
* TLS 1.2 connection using TLS_RSA_WITH_AES_128_CBC_SHA
* ALPN, server did not agree to a protocol
* Server certificate: cms.opendata-oepnv.de
* Server certificate: Let's Encrypt Authority X3
* Server certificate: DST Root CA X3
> HEAD /fileadmin/datasets/delfi/20200401_fahrplaene_gesamtdeutschland_gtfs.zip HTTP/1.1
> Host: cms.opendata-oepnv.de
> User-Agent: curl/7.69.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Sat, 11 Apr 2020 13:36:00 GMT
< Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.24 mod_wsgi/3.4 Python/2.7.5
< Last-Modified: Thu, 02 Apr 2020 12:08:30 GMT
< Accept-Ranges: bytes
< Content-Length: 261613986
< Cache-Control: max-age=2592000
< Expires: Mon, 11 May 2020 13:36:00 GMT
< X-UA-Compatible: IE=edge
< X-Content-Type-Options: nosniff
< Content-Type: application/zip
< 
  0  249M    0     0    0     0      0      0 --:--:--  0:00:04 --:--:--     0* SSLRead() return error -9806
  0  249M    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0
* Closing connection 0
curl: (56) SSLRead() return error -9806
derhuerst commented 4 years ago

I implemented a temporary workaround: https://delfi-gtfs-url.now.sh/api/latest redirects to the latest zip URL that returns 2xx.

derhuerst commented 4 years ago

I implemented a temporary workaround: https://delfi-gtfs-url.now.sh/api/latest redirects to the latest zip URL that returns 2xx.

The workaround is broken because the download doesn't work without a login cookie anymore. 😢

derhuerst commented 3 years ago

@juliuste has built the workaround's successor: https://github.com/juliuste/opendata-oepnv/blob/main/readme.md