kevinw1998 / nightjetter Goto Github PK
View Code? Open in Web Editor NEWUnofficial API to get some information about nightjet connections
Unofficial API to get some information about nightjet connections
I get the error
"Object of type Passenger is not JSON serializable"
Here is the complete error:
nj.findOffers("Wien","Rom",datetime.date(2024,6,1),oebb.MA)
Traceback (most recent call last):
File "", line 1, in
File "/Users/vthoss/Jupyter/main.py", line 131, in findOffers
response = self.__session.post(
^^^^^^^^^^^^^^^^^^^^
File "/Users/vthoss/anaconda3/lib/python3.11/site-packages/requests/sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/vthoss/anaconda3/lib/python3.11/site-packages/requests/sessions.py", line 575, in request
prep = self.prepare_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/vthoss/anaconda3/lib/python3.11/site-packages/requests/sessions.py", line 486, in prepare_request
p.prepare(
File "/Users/vthoss/anaconda3/lib/python3.11/site-packages/requests/models.py", line 371, in prepare
self.prepare_body(data, files, json)
File "/Users/vthoss/anaconda3/lib/python3.11/site-packages/requests/models.py", line 511, in prepare_body
body = complexjson.dumps(json, allow_nan=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/vthoss/anaconda3/lib/python3.11/json/init.py", line 238, in dumps
**kw).encode(obj)
^^^^^^^^^^^
File "/Users/vthoss/anaconda3/lib/python3.11/json/encoder.py", line 200, in encode
chunks = self.iterencode(o, _one_shot=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/vthoss/anaconda3/lib/python3.11/json/encoder.py", line 258, in iterencode
return _iterencode(o, 0)
^^^^^^^^^^^^^^^^^
File "/Users/vthoss/anaconda3/lib/python3.11/json/encoder.py", line 180, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type Passenger is not JSON serializable
The OffersFiltered function does not seem to work properly anymore, maybe because the output of nightjet.com has changed?
Thanks for your help :) Really appreciate your code!
PyError ($(Expr(:escape, :(ccall(#= /Users/XXX/.julia/packages/PyCall/ilqDX/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'TypeError'>
TypeError("string indices must be integers, not 'str'")
File "/Users/XXX/./main.py", line 122, in findOffersFiltered
if "Kein Storno" in offer["prodGroupLabels"]:
Is there a list of the id's of all the discount cards? In the code only a few examples are given. I would e.g. be interested in the Interrail Pass one. Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.