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-api-key": "l7xx944d175ea25f4b9c903a583ea82a1c4c",
    "x-app-id": "air-booking",
    "x-channel-id": "southwest",
    "x-swa-di-dtid": "db1c86523c23f01f809ab1b6f6052317e311",
    "x-swa-di-pid": "undefined",
    "x-swa-di-ue": "",
    "x-swa-di-uid": "undefined",
    "x-swa-di-usid": "undefined",
    "x-user-experience-id": '58e15b33-b2b2-4dda-a4c3-1a5317615943'

}
headers.update(
{"ee30zvqlwf-f":"A07rirWKAQAAaUMu6wjffA5wFm2bcgOLOan6_ZcrLfumASSVRqiFk_2jwNfWASaWDxCucirJwH9eCOfvosJeCA==","ee30zvqlwf-b":"tpfjlq","ee30zvqlwf-c":"AI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q4JX=Nixdijtrgn_c2zPO-9B_01N8f0ozZNO_T3oiXWA3dy0R6EZ9Xjh2irPFEzuNz8u_ezCp788n8sQZ47EOpPJfc71sl7tXWNHUejrxl25PIt=5qmgDu0t53YFQ5_mZwiFPtEueAPw8AF0Iy4ZqqPB4bEhBgz6Ll7WsPryWd-Ms3RkxhgbO663UxV55v1NRjTDV4sfEsgvM69jEbFD9Ovi-IVvWWZNy4bxvu38NcJjZxKpf3waZMTzXQ=i4GwANCcZgEK4bNe7VRiHinACuOeYpDvOJxkAgaJHu2_FQNV6tzdKv8qXszZfy1HR_lTbk-Yqa5r5srVbUF0WBwxy5ZLR1LUZaxUZiKeOnblhf9hoYeGVHHRKKflYOgCJ0xnpZn1eG4_c4aJ6DFZxLjL1WzmpiwNaaT05iKYVnQ8g06NmaqraGL2Ekj-EoZr2W6qjpuHocVU40AwLonhBinIOQvG1zTZTy-2ioIum9VrznMqwyGl61i_w5OOg1P8=ITf99irAdQIGyz5UAnPHuTuT6bV49sW5BBUITOByjm6fL0INPqTkRBzwlQH6tEUJ-pKAgrtyLzV=KhH=U7yybA8qWt1Ie3E8jwR3L2Owlk2_DfcL2QOLEOuLrCfYMlMMRy98YQ65--wgMxFg2uIa7a0B7suhb3lm5sQICiNLI5ADZU1=k_Qn3UD=4Mzk4=71t9AwmDA=LIE0bwvfiBXM6pfw_Hv280gbl4f-Mk1fDfDc92LqbH3l3KtxD=VmV3H0lvNMO2kBFCODaG3VA=--iX5aMpYupuntFA6mw-lhW-W_gLBdTUuxA=b0dXzCwQNGx98IGAE=c","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-08-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)