From 25f902cd62226a140342cc2c9d404f7868c5a8fd Mon Sep 17 00:00:00 2001 From: JeanExtreme002 Date: Mon, 25 Dec 2023 00:51:44 -0300 Subject: [PATCH] improved method search() --- python/FlightRadar24/__init__.py | 2 +- python/FlightRadar24/api.py | 4 ++-- python/FlightRadar24/core.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/FlightRadar24/__init__.py b/python/FlightRadar24/__init__.py index b15b946..4536885 100644 --- a/python/FlightRadar24/__init__.py +++ b/python/FlightRadar24/__init__.py @@ -13,7 +13,7 @@ """ __author__ = "Jean Loui Bernard Silva de Jesus" -__version__ = "1.3.21" +__version__ = "1.3.22" from .api import FlightRadar24API, FlightTrackerConfig from .entities import Airport, Entity, Flight diff --git a/python/FlightRadar24/api.py b/python/FlightRadar24/api.py index bd28805..0d56592 100644 --- a/python/FlightRadar24/api.py +++ b/python/FlightRadar24/api.py @@ -361,11 +361,11 @@ def get_zones(self) -> Dict[str, Dict]: return zones - def search(self, query: str) -> Dict: + def search(self, query: str, limit: int = 50) -> Dict: """ Return the search result. """ - response = APIRequest(Core.search_data_url.format(query), headers = Core.json_headers) + response = APIRequest(Core.search_data_url.format(query, limit), headers = Core.json_headers) results = response.get_content().get("results", []) stats = response.get_content().get("stats", {}) diff --git a/python/FlightRadar24/core.py b/python/FlightRadar24/core.py index 0ceb1fa..9032f10 100644 --- a/python/FlightRadar24/core.py +++ b/python/FlightRadar24/core.py @@ -20,7 +20,7 @@ class Core(ABC): most_tracked_url = flightradar_base_url + "/flights/most-tracked" # Search data URL - search_data_url = flightradar_base_url + "/v1/search/web/find?query={}&limit=50" + search_data_url = flightradar_base_url + "/v1/search/web/find?query={}&limit={}" # Flights data URLs. real_time_flight_tracker_data_url = data_cloud_base_url + "/zones/fcgi/feed.js"