JeanExtreme002 / FlightRadarAPI

:airplane: Unofficial SDK for FlightRadar24 for Python 3 and NodeJS
https://pypi.org/project/FlightRadarAPI/
MIT License
296 stars 60 forks source link

AttributeError: 'bytes' object has no attribute 'items' #69

Closed caro-acdm closed 3 months ago

caro-acdm commented 6 months ago

Describe the bug The python script unexpectedly stops with this error. I have been using the api for a month, but this error is as recent as 23/04/2024.

Portion of error:

File "D:\Pxxx_Dxxx\Lib\site-packages\FlightRadar24\api.py", line 314, in get_flights for flight_id, flight_info in response.items(): ^^^^^^^^^^^^^^ AttributeError: 'bytes' object has no attribute 'items'


System (please complete the following information):

JeanExtreme002 commented 6 months ago

Could you please try to reproduce this error again, executing the same steps you have done and inserting a print(response) to the code, before that line?

caro-acdm commented 6 months ago

I tried printing the response, but haven't been able to reproduce the attribute error yet. I will post as soon as I am able to catch it. I am currently using try-except to catch the attribute error.

JeanExtreme002 commented 3 months ago

I'm closing this issue for now.

I analyzed the problem and the reason is an unexpected content-encoding in the header. I would need to know what response was received by the server.

If you get this error again or have more information about the problem, please reopen the issue and send it here.