Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
georgehawkins0 committed Jan 3, 2022
1 parent 1dc33c5 commit d764991
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,4 @@ dmypy.json
.pyre/

# custom

/out
/out
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,4 @@ options:
## To-do

- airport name search for IATA code
- Live flight tracker


Thx flightradar for making api easily reversable :)
- Live flight tracker
6 changes: 3 additions & 3 deletions airports.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def statusConverter(status):
return "Departed"

def apiReq(airport,arrivalsOrDepartures,page):
headers = {
_headers = {
'authority': 'api.flightradar24.com',
'pragma': 'no-cache',
'cache-control': 'no-cache',
Expand All @@ -43,7 +43,7 @@ def apiReq(airport,arrivalsOrDepartures,page):
'accept-language': '',
}

params = (
_params = (
('code', airport),
('plugin/[/]', 'schedule'),
('plugin-setting/[schedule/]/[mode/]', arrivalsOrDepartures),
Expand All @@ -52,7 +52,7 @@ def apiReq(airport,arrivalsOrDepartures,page):
('limit', '100'),
('token', ''),
)
r = requests.get('https://api.flightradar24.com/common/v1/airport.json', params=params,headers=headers)
r = requests.get('https://api.flightradar24.com/common/v1/airport.json', params=_params,headers=_headers)

response = json.loads(r.text) #dict_keys(['result', '_api'])
return response
Expand Down

0 comments on commit d764991

Please sign in to comment.