Hi! Having just transferred from a Deutsche Bahn ICE to a TGV, I was curious to see if there was a similar API for requesting the train speed and indeed there was :D I wasn't sure how to read values from the websocket until I found this project, but this unfortunately did not seem to work. I got the following error:
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): wifi.sncf:443
DEBUG:urllib3.connectionpool:https://wifi.sncf:443 "GET /socket.io/?transport=polling&EIO=4&t=1651772050.4105353 HTTP/1.1" 200 103
Traceback (most recent call last):
File "/home/ashley/TerminalGV/main.py", line 43, in <module>
sio.connect('https://wifi.sncf/')
File "/usr/lib/python3.10/site-packages/socketio/client.py", line 338, in connect
raise exceptions.ConnectionError(exc.args[0]) from None
socketio.exceptions.ConnectionError: OPEN packet not returned by server
Luckily I realised that there was a fetch api as well, so you can just curl https://wifi.sncf/router/api/train/gps
etc. instead.