AWeirdDev / flights

Fast, robust Google Flights scraper (API) for Python. (Probably)
https://pypi.org/project/fast-flights
35 stars 9 forks source link

[WIP] Using script data #13

Open kftang opened 2 months ago

kftang commented 2 months ago

Thanks for your work in reverse engineering the tfs protobuf!

I wanted to have access to flight numbers but noticed the original parser wasn't able to handle this as the information doesn't exist until you open the detailed view for each flight.

I was looking at the available data in the response and noticed that there is some static JS data that contains all the flight data. This is a little tricky though as the schema for this data is in some proprietary format (I'm guessing protobuf?) and I couldn't find an easy way to decode it.

The data is a lot of nested lists, with some value types in between. It looks like the data is well formed, so we should be able to reverse engineer the schema. I'm using the data_discovery notebook to do this.

TODO:

BTW I noticed the use of the old type annotations format (typing.List rather than list), is there any requirement to support an older python version? If not I'll change these to the new generic aliases.

AWeirdDev commented 2 months ago

Woah, that's a lot of changes. I'll probably take a look on Saturday.

Thanks, AWeirdDev