import tls_client

session = tls_client.Session(client_identifier='chrome_112')
url = "https://www.spirit.com/api/prod-token/api/v1/token"
data = {
    "applicationName": "dotRezWeb"
}

cookies = {
    "rxVisitor": "1700027313771L5H3HKU7HLR0P7L4VNDKVF35MQJ3RO44",
    "userCountryLocation": "US",
    "userGeolocation": "-121.9858, 37.5710",
    "_pxhd": "76a5fc0e989d4325bcee72ba2ced3cb7502333468537a08718a53dd20d66cb9a:9d81668a-837a-11ee-bc0c-ccadff7955f6",
    "bm_sz": "BE3552988E319DFE06E96220E4389F55~YAAQlvTVFxk0PM+LAQAAATOG0RVo4/s97TsnB+BIxQYuNknYXcbwlyPDbigKc6PyDa1FlQuMeMq2P/EfVXxwvnsJjeg9vrTv/bMxdZTh1ZsFOgZ6DpA9ZP+xuGowSAqUGWTAPZORUgR60OcMVZh8zof92SVw5O7Jj7IRwYOWoIBirWOaorHM1gOyptB9irFsza4MXY9zoaAr+kUAgKI+qa3yyCduaQtcPVHoWEd5B5zqM7vCkTtdKcflPc/2QUX9vQeByAu6QUhkgFKLWw0yx1UOciAiqhr6kKFGl3Grg6tnb4w=~3227973~3684420",
    "PIM-SESSION-ID": "h0eUxvYe9fOrnkvt",
    "_pxvid": "9d81668a-837a-11ee-bc0c-ccadff7955f6",
    "pxcts": "a11fbf4d-837a-11ee-8073-778b86be1060",
    "ak_bmsc": "5F5BC952B8085705C52F23BC62DBE73B~000000000000000000000000000000~YAAQlvTVF0A5PM+LAQAAUkuG0RWgiZbQ1FYtdOmP1/1xiKHaN+2ci73NE6epO/THxsu6ek59FE+ExBc6yyGXz6++gEUqLbtQdktgDy+Mht/9CGvQVNV8cyF4YgwPde8SWQROufP0UH/vyZNWej9N2rGRqtvXDWh7WIZKbw/Pw42mlxG44exkHc9gpyMCPI9/qzp2WLPoZPwEhcSmEIHg7ZAzBKe8fKWrdhtBW2tJtzAkYky0CGjeAldle7afNjzuMp/pK0CXUbp/lzk5vJfE7Z5eX6+VMVs+hLD6LsWv5R3DjmoYBLSTinuIPTQB1hdlFJ1jwikDroWuKCn0k/UNsE80H6heJngwRBvdQfZxpkyPMHfIg1AABr83BSUhAdrcHhkdULIYnVQLwci+Mgat4kVR0ZFPqJJ/rC7jMct1XGM3h1wMnFYDDFNEf86CW23YSoxC/MKmK6vA3jb4UJrA0NziU21ly3xhzYdyB1UTDiYTF2Jnko1mj5Ypsv0VUw==",
    "dtCookie": "v_4_srv_6_sn_IUCGVPVF7GK0EE1KTCUACL20BM3FJRSC_app-3A73bede5a20cee83c_1_ol_0_perc_100000_mul_1_rcs-3Acss_0",
    "CURRENT_CULTURE": "en-US",
    "ORA_FPC": "id=644191f7-90cd-4bee-9fca-35f98d0b43f2",
    "WTPERSIST": "",
    "_gcl_au": "1.1.579054859.1700027324",
    "_ga": "GA1.1.722834412.1700027324",
    "_yoid": "2dac7801-644c-40dd-ad14-82588be413fc",
    "_yosid": "54621d25-7aa9-49c3-9c84-297be5dc5f87",
    "_mibhv": "anon-1700027325573-5372561741_7060",
    "_pin_unauth": "dWlkPVpEY3dOV1V6TlRNdFpXUTBZaTAwTlRNNUxXSm1Oekl0WXpZd09HTTNPV1F5WVRFMA",
    "_ctz_variation": "placebo-1%253A99-456c07caead5e3bf9b13bcf45821feda=1&optSetWidgetEndpoints-90%253A10-9f30ca063cf6ace3b7e85b16368565e6=0",
    "QSI_HistorySession": "https%3A%2F%2Fwww.spirit.com%2F~1700027464184",
    "OptanonAlertBoxClosed": "2023-11-15T05:51:29.606Z",
    "mmapi.p.bid": "%22prodphxcgus01%22",
    "mmapi.p.srv": "%22prodphxcgus01%22",
    "mmapi.p.pd": "%22fgpSWUWiaYjo9_9yESZFKOi4XaqcmMi6ZD7ryKElpdg%3D%7CAwAAAApDH4sIAAAAAAAEAGNhsCzVMhKSOCLKwFyQUcEoxMDoxGDuInmEkWHllpev5j297eE7IxNMMwDBfyhgYHPJLEpNLmEUkmAEiYPBMSFmhmIzZoZnhswMnAyugYwM014szeIRkgBrAyoVkvj_H6gcrIPxCVBV4WIWBgZZd0aGdfpTWdfgUHgcaOyMahYGRpD5IL3aXowMXb4h79_i0PBYmpmhth1o8tMARgat1RIeB3Ao3GvAzOC9CKhwXxAjg4y_s-YVHAq9gb6atRKo8AxQocH1KFZhHAqLgAp_rAC6FRQOILdaBzMy7BOrtC3BoeGFOTPDhFVAk2eFMDKs6ZSc0odDobkNM0P3eqBCN2C4NvCnBZXjUPgKGK75wHBlBEUDOKhBkcPoCgC9P4mN6gEAAA%3D%3D%22",
    "showCCPopup": "false",
    "mmapi.e.mm_data_user": "%7B%22isGuest%22%3Atrue%2C%22userId%22%3Anull%2C%22sessionId%22%3A%221700027321910.cllrrdxk%22%2C%22loyaltyID%22%3Anull%2C%22loyaltyTier%22%3A%22guest%22%2C%22loyaltyTierPoints%22%3Anull%2C%22loyaltyMembershipType%22%3A%22SD%22%2C%22loyaltyMembershipPoints%22%3Anull%2C%22postalCode%22%3Anull%2C%22country%22%3Anull%2C%22countryCode%22%3Anull%2C%22age%22%3Anull%2C%22countryCallingCode%22%3A%22%22%2C%22dateOfBirth%22%3Anull%2C%22email%22%3Anull%2C%22firstName%22%3Anull%2C%22firstSession%22%3Atrue%2C%22gender%22%3A%22%22%2C%22hasTransacted%22%3Afalse%2C%22homeAirportCode%22%3Anull%2C%22language%22%3A%22English%22%2C%22lastName%22%3Anull%2C%22mastercardHolder%22%3Afalse%2C%22phoneNumber%22%3Anull%2C%22secondaryAirportCode%22%3Anull%2C%22username%22%3Anull%2C%22timeUntilDeparture%22%3A%22%22%2C%22searchTime%22%3A%22%22%7D",
    "mmapi.p.uat": "%7B%22PriceSensitive%22%3A%22No%22%2C%22COVIDEngage%22%3A%22No%22%2C%22ReservationCred%22%3A%22No%22%2C%22Language%22%3A%22English%22%2C%22FreeSpirit%22%3A%22No%22%2C%22Mastercard%22%3A%22No%22%2C%22NineDollarFC%22%3A%22No%22%2C%22PrevPurchase%22%3A%22false%22%2C%22PrevPurchBag%22%3A%22false%22%2C%22PrevPurchSeats%22%3A%22false%22%2C%22PrevPurchThrill%22%3A%22false%22%2C%22PrevPurchPkg%22%3A%22false%22%2C%22LoggedIn%22%3A%22No%22%2C%22Age%22%3A%22%22%2C%22LeadTime%22%3A%22%22%2C%22BookDate%22%3A%22%22%2C%22Bags%22%3A%22undefined%22%7D",
    "dtSa": "-",
    "bm_sv": "2024462CF14D22CD5AC4DBE991280553~YAAQlvTVF5IZPc+LAQAABEeL0RVakxsbkPZYLgP4oCbh72NVxwxcxNZ//eIVGzMTEbJuduXSdPzphTLscNeUQrRn9GhttjJXa5/La2CGj0JRx8gY/Wmc6DcrtWJZNGgvHiua08DekqpjfTwbrpxnyVcQNuLJxwYaf+tihHmkBq40uL2jKAI4yJBMo/hNi8srwffGL4J69nC3zGH94gDmKgf1HvWoyzWAteEY1LDSiYoX89yZa3mmIfICJVPKyXKC~1",
    "OptanonConsent": "isGpcEnabled=0&datestamp=Wed+Nov+15+2023+13%3A54%3A08+GMT%2B0800+(%E4%B8%AD%E5%9B%BD%E6%A0%87%E5%87%86%E6%97%B6%E9%97%B4)&version=202211.2.0&isIABGlobal=false&hosts=&consentId=001d89d1-0842-4277-a5ba-5ba86561389d&interactionCount=2&landingPath=NotLandingPage&groups=C0002%3A1%2CC0003%3A1%2CC0004%3A1%2CC0001%3A1&geolocation=US%3B&AwaitingReconsent=false",
    "_ga_VKEG2ZBNZ5": "GS1.1.1700027324.1.1.1700027649.55.0.0",
    "_px2": "eyJ1IjoiZjI0MTc5NTAtODM3YS0xMWVlLWE2ZDUtYWI4OTdjMmNmMTEyIiwidiI6IjlkODE2NjhhLTgzN2EtMTFlZS1iYzBjLWNjYWRmZjExNTVmMiIsInQiOjE2MDAwMjc3NjAwMDYsImgiOiJhN2MzODU4ZDM3OWI2MjI1ZDBkYzdiMDYxNWY5NDc1YmQyZTU3M2YzMGM2YzNjNDRjZTFhYWIxZmQ0YTdkMGI3MiJ9",
    "fs_lua": "1.1700027657805",
    "fs_uid": "#NC1WY#b63b46e3-7efa-4cd3-842d-55d288cccabd:6f224067-f9e5-4842-bb68-535bb1968e8f:1700027329348::3#/1731563328",
    "_ctuid": "6e14c47f-06f8-4e1c-8d62-ff9433507a54",
    "_ctpuid": "62a8b41b-0328-466e-95b6-b932a818ab63",
    "_pxde": "fa1fcb9ddf7e3f980d5f01864d8d9d6c6b3b18f20792cea486a3bb53de81e7fd:eyJ0aW1lc3RhbXAiOjE3MDAwMjc3MDQ1ODR9",
    "_pageviewUUID": "0e510bec-c5d7-4284-868e-15294f7f1f38",
    "_abck": "D8458A31293EEC1F586B42594B90A22E~-1~YAAQlvTVF+VHPc+LAQAAgjiM0QpNbqOlylO8AyD2skn9e3+WXEgKRSA0C6lKhb+3jO4jHXB2vCL5Bg6NZq2H35siZN3gi5hVPn5fCDLC/bPoxgpw7thWGiQXXSJbwA/HFpG3FRLRw1MBkyy6yfIeBaL/wZxJnoQPW0SMuso7xgNVVRZQGR8r0atqbEso3EwAby84wuLElcP6wBJTK/dr26S2I7ItRmNjoGwHxNnCGAOk+zb9qT4+TBfRmdHJAE8xK8U2pZGuCKCYXkv0wiL2ag6P5v9o2fcM7yZGXXFLtYxomx6N62IfyLy+KApnj8KVnSFXYN7klpmkiDuJ+FhZyQU0ffTVg1BK25DpZreaz/yN2l4PzA2o1AIs5gON1Cz3NKq5nxPlL3ZfKSg5M7PPbLltefH2Yn4j~0~-1~1700031067",
    "dtPC": "6$227646043_302h20vHUJJPLCCFKEKCKCIBIRGUBSSFAHKQPTC-0e0",
    "rxvt": "1700029516680|1700027313770"
}

cookies.update(
 {
    # "_pxvid": "394da189-837c-11ee-bdde-eaea89be1e74",
    # "_pxde": "3a352ba3f42d3611d577c5e77b0017c8c6eb2f5b5686fbfef35a80cb308db850:eyJ0aW1lc3RhbXAiOjE3MDAwMjgwMTAzMjV9",
    # "_px2": "eyJ1IjoiZTc3M2NlMzEtOTVlNy00ODFmLWI0NTgtMWY3N2NhYzBiNmIyIiwidiI6IjM5NGRhMTg5LTgzN2MtMTFlZS1iZGRlLWVhZWE4OWJlMWU3NCIsInQiOjYyMDIzMzg4MDAwNCwiaCI6ImZiNjBjMjBmMjA2YjQ1ZjNjZTMwMzgxNWQ4NDQzOGFlZmYxZGM5NmVhMDE4MWI2M2U5ZWUxMjcwNTFmODQwODgifQ==",
    # "pxcts": "3a5e111a-837c-11ee-86af-12e2d33ad6dd",
    # "_pxhd": "f85d11813459ae2c363e2697c7564aa252f18a2e2147091ced35f342b66d2add:394da189-837c-11ee-bdde-eaea89be1e74",
}
)

response = session.post(url, headers={
    "authority": "www.spirit.com",
    "accept": "application/json, text/plain, */*",
    "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",
    "ocp-apim-subscription-key": "dc6844776fe84b1c8b68affe7deb7916",
    "origin": "https://www.spirit.com",
    "pragma": "no-cache",
    "referer": "https://www.spirit.com/",
    "sec-ch-ua": "\"Google Chrome\";v=\"117\", \"Not;A=Brand\";v=\"8\", \"Chromium\";v=\"117\"",
    "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/117.0.0.0 Safari/537.36",
    "x-dtpc": "8$216560782_634h19vKIAKIMFGTUTKRWPPLDKCSORJAIECKGLH-0e0"
}, cookies=cookies,json=data, proxy={
    'http': 'http://127.0.0.1:8890',
    'https': 'http://127.0.0.1:8890',
}, insecure_skip_verify=True)

print(response.text)
print(response)
print(response.status_code)
