We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0609ec5 commit 4061233Copy full SHA for 4061233
SRT/srt.py
@@ -300,6 +300,10 @@ def _search_train(
300
# Note: updated api returns subarray of all trains,
301
# therefore, to retrieve all trains, retry unless there are no more trains
302
while trains:
303
+ # Break if the last train's departure time is over the time_limit
304
+ if time_limit and trains[-1].dep_time > time_limit:
305
+ break
306
+
307
last_dep_time = datetime.strptime(trains[-1].dep_time, "%H%M%S")
308
next_dep_time = last_dep_time + timedelta(seconds=1)
309
data["dptTm"] = next_dep_time.strftime("%H%M%S")
0 commit comments