From 24a182a1f99ef42f5e9fef3bfefc1aa2347aebb2 Mon Sep 17 00:00:00 2001 From: DaPheles Date: Tue, 17 Sep 2024 23:50:14 +0200 Subject: [PATCH 1/2] Functional extension to follow one particular flight by FlightRadar24 id --- python/FlightRadar24/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/FlightRadar24/api.py b/python/FlightRadar24/api.py index 79007d0..dda41cc 100644 --- a/python/FlightRadar24/api.py +++ b/python/FlightRadar24/api.py @@ -285,7 +285,8 @@ def get_flights( registration: Optional[str] = None, aircraft_type: Optional[str] = None, *, - details: bool = False + details: bool = False, + id: Optional[str] = None, ) -> List[Flight]: """ Return a list of flights. See more options at set_flight_tracker_config() method. @@ -306,6 +307,7 @@ def get_flights( if bounds: request_params["bounds"] = bounds.replace(",", "%2C") if registration: request_params["reg"] = registration if aircraft_type: request_params["type"] = aircraft_type + if id: request_params["selected"] = id # Get all flights from Data Live FlightRadar24. response = APIRequest(Core.real_time_flight_tracker_data_url, request_params, Core.json_headers, timeout=self.timeout) From 0d4d9e303f25a841ddf5a12ea9aeee0e00dd96a6 Mon Sep 17 00:00:00 2001 From: DaPheles Date: Thu, 19 Sep 2024 09:36:18 +0200 Subject: [PATCH 2/2] attribute id renamed to flight_id to avoid conflict with id() --- python/FlightRadar24/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/FlightRadar24/api.py b/python/FlightRadar24/api.py index dda41cc..76f3213 100644 --- a/python/FlightRadar24/api.py +++ b/python/FlightRadar24/api.py @@ -286,7 +286,7 @@ def get_flights( aircraft_type: Optional[str] = None, *, details: bool = False, - id: Optional[str] = None, + flight_id: Optional[str] = None, ) -> List[Flight]: """ Return a list of flights. See more options at set_flight_tracker_config() method. @@ -307,7 +307,7 @@ def get_flights( if bounds: request_params["bounds"] = bounds.replace(",", "%2C") if registration: request_params["reg"] = registration if aircraft_type: request_params["type"] = aircraft_type - if id: request_params["selected"] = id + if flight_id: request_params["selected"] = flight_id # Get all flights from Data Live FlightRadar24. response = APIRequest(Core.real_time_flight_tracker_data_url, request_params, Core.json_headers, timeout=self.timeout)