import requests
import json
import tls_client

session = tls_client.Session(client_identifier='chrome_112')
proxy = 'http://127.0.0.1:7890'
session.proxies = {
    'http': proxy,
    'https': proxy,
}
headers = {
    "authority": "www.southwest.com",
    "accept": "application/json, text/javascript, */*; q=0.01",
    "accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6",
    "cache-control": "no-cache",
    "content-type": "application/json",
    "origin": "https://www.southwest.com",
    "pragma": "no-cache",
    "referer": "https://www.southwest.com/air/booking/select.html?int=HOMEQBOMAIR&adultPassengersCount=1&departureDate=2023-09-21&destinationAirportCode=LAX&fareType=USD&originationAirportCode=LAS&passengerType=ADULT&promoCode=&returnDate=2023-09-24&tripType=roundtrip&from=&to=&adultsCount=1&departureTimeOfDay=ALL_DAY&reset=true&returnTimeOfDay=ALL_DAY",
    "sec-ch-ua": "\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Google Chrome\";v=\"114\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"macOS\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
    "x-app-id": "air-booking",
    "x-channel-id": "southwest",
    "x-swa-di-ue": "",
    "x-swa-di-uid": "undefined",
    "x-swa-di-usid": "undefined",
}
headers.update(
{"ee30zvqlwf-f":"A586sLKKAQAASi1BIIkGbzAbB-fA0lGgBkMLwlJAUslzb4qtFiMmDMDLv0Y-AUFL3UyuchRAwH9eCOfvosJeCA==","ee30zvqlwf-b":"-54816n","ee30zvqlwf-c":"AIAMrbKKAQAA36eKi9WfpgupQVx9bzf_ntzFNOjSFdtsU2duDcWnXCZp2jac","ee30zvqlwf-d":"ABaAhIDBCKGFgQGAAYIQgISigaIAwBGAzvpizi_33wfFp1wmado2nAAAAAARlRtVAJN0qp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wcRg6JbcmcyU9Dohecu9taujyF5CI1P01cCWVwtexOSIY86rB_6nrJkp_V_68zXXrSk1YH5B4dDB00pRZGag99iUEMK-_EFwdy1i8vnR80J7v=nVXiY0P_n-NtJ6swxdHkK8MbY=eOgwK8u-VzGa0HNn-c0FGlniTzR1vXUPFT1QIl7rIdt=GDPN2wS0y=LtRCiEBUwRkwvGH-sL6u6gSNKiOh9clibJPiF7g3EX8WNihg9gSi=axV9aN5PL-BYDKk8S3WK7_y=c9cw==J0T87E8UXgA76bo_5GGYEmuLphbmOjezW9G0gHNCG9vT=3uZCpQYJpbp9Y3PzIvwz2r00-uVrj1mcvbckJ4p7X6LlmzokoiY_2hIMFd4soNOFqp4dB4pFWzXsDZq3uAc3KjFUW2oDiW=rKpWVrins32ESrLJy2ZTY9hlcDzFhtkDgg4GdRDh44PvxJTIKMz0phg7j0eGgSX2CEseYwlQAw0zna4ytbpudIRhyq8dyzM5D4eH9DZBUueWXSUQi=sEKILpM=Kk9KFLtwAXwm0=GKdLs7NYbiTNeXjerZ8hMPhlornh7JBkQRiEuUpU56GJ84OdBwN3=5iUx76dVXioDwj5odKDESccytW7ZuEL_1VsCFe4g3s1q4ELrrNGaEHjbFd7QoVzelsEQlpKxRq","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"}


)
url = "https://www.southwest.com/api/air-booking/v1/air-booking/page/air/booking/shopping"
data = {
    "adultPassengersCount": "1",
    "adultsCount": "1",
    "departureDate": "2023-09-22",
    "departureTimeOfDay": "ALL_DAY",
    "destinationAirportCode": "LAX",
    "fareType": "USD",
    "from": "",
    "int": "HOMEQBOMAIR",
    "originationAirportCode": "LAS",
    "passengerType": "ADULT",
    "promoCode": "",
    "reset": "true",
    "returnDate": "2023-09-24",
    "returnTimeOfDay": "ALL_DAY",
    "to": "",
    "tripType": "roundtrip",
    "application": "air-booking",
    "site": "southwest"
}
data = json.dumps(data, separators=(',', ':'))
response = session.post(url, headers=headers, data=data)

print(response.text)
print(response)