import tls_client

session = tls_client.Session(client_identifier='chrome_117')
session.proxies = {
    'http': 'http://127.0.0.1:7890',
    'https': 'http://127.0.0.1:7890',
}


# prox = 'http://user-uni001-region-us-sessid-1111-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
prox = 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:9000'
# prox = 'http://127.0.0.1:7890'
session.proxies = {
    'http': prox,
    'https': prox,
}
# session.proxies = {
#     'http': "http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:11400",
#     'https': "http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:11400",
# }
headers = {
    "authority": "booking.flyfrontier.com",
    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "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",
    "pragma": "no-cache",
    "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": "document",
    "sec-fetch-mode": "navigate",
    "sec-fetch-site": "same-origin",
    "sec-fetch-user": "?1",
    "upgrade-insecure-requests": "1",
    "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"
}

headers['cookie'] =  '_gcl_au=1.1.2146924139.1699349071; _gid=GA1.2.1600529178.1699349074; _fbp=fb.1.1699349075532.386303519; _tt_enable_cookie=1; _ttp=P8kKbrNobKZ2GVibPD09fxd__BY; _pin_unauth=dWlkPVpEYzFaVEJsTW1NdE5UY3pPQzAwTWpVeUxXSTVOVEF0TkRjMVptTXlOamhsWlRrNA; _up=1.2.724730174.1699349077; wisepops=%7B%22csd%22%3A1%2C%22popups%22%3A%7B%22429858%22%3A%7B%22dc%22%3A1%2C%22d%22%3A1699349078060%7D%7D%2C%22sub%22%3A0%2C%22ucrn%22%3A30%2C%22cid%22%3A%2278471%22%2C%22v%22%3A4%2C%22bandit%22%3A%7B%22recos%22%3A%7B%7D%7D%7D; pxcts=ecee77ca-7d4f-11ee-b00a-fb02dfc227ba; _pxvid=ecee6d06-7d4f-11ee-b00a-034ff0a158cd; ORA_FPC=id=9a05e14f-61e6-446d-93a7-dbd521aef582; WTPERSIST=; wisepops_visits=%5B%222023-11-07T10%3A02%3A56.166Z%22%2C%222023-11-07T10%3A01%3A57.407Z%22%2C%222023-11-07T10%3A00%3A05.868Z%22%2C%222023-11-07T09%3A58%3A45.666Z%22%2C%222023-11-07T09%3A54%3A20.305Z%22%2C%222023-11-07T09%3A41%3A15.316Z%22%2C%222023-11-07T09%3A40%3A10.528Z%22%2C%222023-11-07T09%3A27%3A52.040Z%22%2C%222023-11-07T09%3A27%3A13.951Z%22%2C%222023-11-07T09%3A24%3A31.239Z%22%5D; wisepops_session=%7B%22arrivalOnSite%22%3A%222023-11-07T10%3A02%3A56.166Z%22%2C%22mtime%22%3A1699351382405%2C%22pageviews%22%3A1%2C%22popups%22%3A%7B%22429858%22%3A9%7D%2C%22bars%22%3A%7B%7D%2C%22sticky%22%3A%7B%7D%2C%22countdowns%22%3A%7B%7D%2C%22src%22%3Anull%2C%22utm%22%3A%7B%7D%2C%22testIp%22%3Anull%7D; dtCookie=v_4_srv_-2D75_sn_GCA74QCN3F5TURM3TP5FU5BR94NQ3GNH; rxVisitor=16993514158835CR4HI1L9971DG7GSTEGCRUTR8KKKIK5; dtSa=-; _ga_XXXX=GS1.1.1699349072.1.1.1699351418.0.0.0; _uetsid=7630b8407d4f11ee968005559e690048; _uetvid=7630d5107d4f11ee8ca7578536cb8873; _gat_UA-2678252-1=1; _ga=GA1.1.147873423.1699349072; _px2=eyJ1IjoiZWQyZjAyYjAtN2Q1NC0xMWVlLTllNWEtOGJjODhkMjFmOGVjIiwidiI6IjYzOGJhZGVhLTdjODQtMTFlZS05YjZjLWViMzBjMGQ1YTg5MyIsInQiOjE2OTkzNTE3MjMxMDksImgiOiI5NDk5ZWI5NGYyMmYzOGU0YWRkZWY0NjUxMTc5YzI1OGI2MTVkNjg3MDc1NjM2ZDUzM2FjZmQ0NzczZDNjNGI4In0=; rxvt=1699353225111|1699351415884; _ga_P2WLKWBNNW=GS1.1.1699349072.1.1.1699351425.53.0.0; dtPC=-75$151415881_960h-vFFEKIKVCJPRALEUAPUCFUWCUTCOHATRP-0e0'

# cks = {'_px2': 'eyJ1IjoiOTY0ODdjMzAtNzk4OC0xMWVlLTgxYTktMjUyZjY0MDdjMTYxIiwidiI6Ijk3NmYxYzBlLTc5ODgtMTFlZS1iODYwLTAyNTVmY2JmZTU2MCIsInQiOjYyMDIzMzg4MDAwNCwiaCI6ImViY2U4ZmQ2ZjA3ZGIxNTkxY2YzMmI0MTg3OTcwZWI5NGY5ZDZkN2I2YjY4NGUxZjJiMjE2MGZlZjQxYWI0MzQifQ==', '_pxvid': '976f1c0e-7988-11ee-b860-0255fcbfe560', 'pxcts': '976f338c-7988-11ee-b860-865043e6e7b4'}


# cks = {}
# cookies.update(
# # {'_pxhd': '728b2d129b5a075513034298f8e2d4ce004425c1f307bd2baa8e9525fa6bb510:4290832e-77db-11ee-bdfb-76e73743688f', '_pxvid': '4290832e-77db-11ee-bdfb-76e73743688f', '_px2': 'eyJ1IjoiYjllMjlkNjEtNzA0MC0xMDMxLTk3ZjUtMjVlOTU0YzUxNGU5IiwidiI6IjQyOTA4MzJlLTc3ZGItMTFlZS1iZGZiLTc2ZTczNzQzNjg4ZiIsInQiOjE2OTg3NDk3MTE3OTksImgiOiIwZmZiOTUwNjRhODJiNzg4Yjg5YzQ1NDMzZThhMWQ5ZjQwNTY3NzcxNjU5MGY5Mjc0ZGNmYWIxY2MwN2RhMzZhIn0=', 'pxcts': '43453788-77db-11ee-a37b-78e6fe245189'}
#
# )

url = "https://booking.flyfrontier.com/Flight/InternalSelect"
params = {
    "s": "true",
    "o1": "DEN",
    "d1": "LAS",
    "dd1": "2023-12-01",
    "dd2": "0001-01-01",
    "mon": "true",
    "adt": "1"
}
# , cookies=cks
response = session.get(url, headers=headers, params=params
                       # ,cookies=
                       # {
                       #     '__RequestVerificationToken': 'NSBimTJq2Tz3K7srdA06s9lx8FAyj-AaBR_mOIlyAFNsvRAlcJXNVR08UcrEteq0MIlB2uYSUu14781gmGWEwr_PBlkoM8-x0oEMAU7t2wJ5X4hJfiOXhNxRhJtoaSRj4wfTDw2',
                       #     '_pxhd': '0e5d5c0858a1eabddde069b91a9a519dd55a7ac230233b565bd124ab687e524f:ab75d635-7d31-11ee-bae4-3977f8e1984d',
                       #     'pxcts': 'adb0e6e6-7d31-11ee-a26c-f9b2b073737d',
                       #     '_pxvid': 'ab75d635-7d31-11ee-bae4-3977f8e1984d',
                       #     '_px2': 'eyJ1IjoiYWNmZmY4NzAtN2QzMS0xMWVlLWE1NDAtMTE1ZTY5YjY2MGM5IiwidiI6ImFiNzVkNjM1LTdkMzEtMTFlZS1iYWU0LTM5NzdmOGUxOTg0ZCIsInQiOjYyMDIzMzg4MDAwNCwiaCI6IjYxZGNlZGI2NDg3ZDFmNDQyZTdjNzdkMWVjMWYzNmJiNjM1YjRjMDkxODY4ZmFmNDdmNTRlY2JjYTE1N2Y2Y2IifQ=='}

                       , allow_redirects=False)

print(response.text)
print(response.url)
