Closed YesItsTheRealIvoie2006 closed 1 year ago
I will be investigating the source code to see if I can narrow down the issue
Core.py seems to be the bad actor here, however It is not your code , its the source, their JSON is not meeting the RFC 8259 standard. However , one can filter the json to correct for the error, see first post, I kindly request that this be implemented, hope to hear from you soon!
Hello @YesItsTheRealIvoie2006 ! Sorry for taking so long to respond to you. I've been (and still am) very busy at my current work, and I haven't had time to understand this problem yet. Could you open a Pull Request please? I will review it as soon as possible.
I appreciate your attention and cooperation!
Hello @JeanExtreme002 ! No worries! I understand the delay. I am at this current moment in time unable to create a PR because there is only one branch , Pull Requests require 2 branches in order to be made. I cannot make a branch as I do not have the permission to do such a thing at this moment in time. The reason PR's require two branches as GitHub states that they need be compared in order to highlight changes between branches.
I kindly ask that you please open up a Development/Beta branch in order to facilitate a PR.
Hi @YesItsTheRealIvoie2006 ! You can fork the branch and open a PR from yours/main
to origin/main
.
Hello again @JeanExtreme002 , thank you for telling me, I have now created a fork. I am going to make a pr as soon as possible , just need to highlight where the offender is in the code so that there is a diff x3, would upload from my PRJ folder on my laptop but that got wiped due to a freak accident I had with drivers on my system. But hey , we live and learn.
Will comment again soon , - Ivoie
Hey @JeanExtreme002 , me again, created that pull request you wanted! it can be found here: https://github.com/JeanExtreme002/FlightRadarAPI/pull/38 #38 Sincearly - Ivoie
Hi again @YesItsTheRealIvoie2006! I have investigated your code of the issue, and the problem is not the response of flightradar24. You are just passing an invalid flight ID. The flight_id
is not the registration of callsign of a flight, but the ID used specifically by flightradar24 website, that you can find by the Flight
object's attribute id
. Example:
>>> fr_api = FlightRadar24API()
>>> flight = fr_api.get_flights("DAL")[0]
>>> print("The correct flight ID is:", flight.id)
The correct flight ID is: 30e81a55
>>> details = fr_api.get_flight_details(flight.id)
>>> isinstance(details, dict) # Checks if it returned details
True
Anyway, thank you for your attention and patience, and I apologize for the delay in investigating the problem.
I'm closing this issue and the PR #38
To avoid this kind of confusion, get_flight_details()
now accepts a Flight
instance as argument.
There is a tempory workround that I have implimented in some of my scripts
^For fetching airports (was correctly implimented) V For fetching more info on an airport
However I am stonewalled when manually attempting to fetch info on a certain flight For example DL200 which is a flight from Atlanta USA to Gautueng SOUTH AFRICA The so called JSON pharser cannot read the data because it doesnt comply with RFC 8259 , one such issue in the garbaled mess of data is the lack of doubble quotes , and the capitalisation of the first letter of booleans where they should be lowercase. Some values such as None get returned without being quoted with the doubbles , thus throws a missing value error
FOR MORE INFORMATION ON THE JAVA SCRIPT OBJECT NOTATION RFC 8259 STANDARD REFER TO : https://www.rfc-editor.org/rfc/rfc8259