AWeirdDev / flights

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

The price is set to '0' for all flights. #16

Open diogoduartec opened 1 month ago

diogoduartec commented 1 month ago

Code built based on the Readme example:

import json
from dataclasses import asdict
from fast_flights import FlightData, Passengers, create_filter, get_flights, Cookies

# Create a new filter
filter = create_filter(
    flight_data=[
        FlightData(
            date="2024-12-30",
            from_airport="MAO",
            to_airport="SDU"
        ),
    ],
    trip="one-way",
    seat="economy",
    passengers=Passengers(
        adults=1,
        children=0,
        infants_in_seat=0,
        infants_on_lap=0
    )
)

# Get flights with a filter
result = get_flights(filter)
print(result)
with open('result.json', 'w') as f:
    json.dump(asdict(result), f, indent=4)

The result price for all flights is '0': image

jack-ireland commented 1 month ago

I had the same issue

When I pulled the library this bug was still in place: https://github.com/AWeirdDev/flights/pull/7/files

I applied the change locally and the issue was fixed

AWeirdDev commented 1 month ago

Yeah, the price thingy just doesn't work even with the pull somehow, I'm looking for ways to fix it (if I have time).

Does anyone here know how to deal with Google's internal APIs? That'd be cool.