FlightRadarAPI 1.3.20__tar.gz → 1.3.21__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@ https://www.flightradar24.com/terms-and-conditions
13
13
  """
14
14
 
15
15
  __author__ = "Jean Loui Bernard Silva de Jesus"
16
- __version__ = "1.3.20"
16
+ __version__ = "1.3.21"
17
17
 
18
18
  from .api import FlightRadar24API, FlightTrackerConfig
19
19
  from .entities import Airport, Entity, Flight
@@ -165,6 +165,21 @@ class FlightRadar24API(object):
165
165
 
166
166
  return airports
167
167
 
168
+ def get_bookmarks(self) -> Dict:
169
+ """
170
+ Get the bookmarks from the FlightRadar24 account.
171
+ """
172
+ if not self.is_logged_in():
173
+ raise LoginError("You must log in to your account.")
174
+
175
+ headers = Core.json_headers.copy()
176
+ headers["accesstoken"] = self.get_login_data()["accessToken"]
177
+
178
+ cookies = self.__login_data["cookies"]
179
+
180
+ response = APIRequest(Core.bookmarks_data_url, headers = headers, cookies = cookies)
181
+ return response.get_content()
182
+
168
183
  def get_bounds(self, zone: Dict[str, float]) -> str:
169
184
  """
170
185
  Convert coordinate dictionary to a string "y1, y2, x1, x2".
@@ -40,6 +40,9 @@ class Core(ABC):
40
40
  # Weather data URL.
41
41
  volcanic_eruption_data_url = flightradar_base_url + "/weather/volcanic"
42
42
 
43
+ # Bookmarks data URL.
44
+ bookmarks_data_url = flightradar_base_url + "/webapi/v1/bookmarks"
45
+
43
46
  # Country flag image URL.
44
47
  country_flag_url = flightradar_base_url + "/static/images/data/flags-small/{}.svg"
45
48
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: FlightRadarAPI
3
- Version: 1.3.20
3
+ Version: 1.3.21
4
4
  Summary: SDK for FlightRadar24
5
5
  Project-URL: Homepage, https://github.com/JeanExtreme002/FlightRadarAPI
6
6
  Author-email: Jean Loui Bernard Silva de Jesus <jeanextreme002@gmail.com>
File without changes