import requests
import tls_client

session = tls_client.Session(client_identifier='chrome_117')

headers = {"authority": "booking.flyfrontier.com", "accept-language": "en-US,en;q=0.9",
           "sec-ch-ua": "\"Google Chrome\";v=\"117\", \"Not;A=Brand\";v=\"8\", \"Chromium\";v=\"117\"",
           "sec-fetch-user": "?1", "upgrade-insecure-requests": "1",
           "cookie": "pxcts=e7eaeb42-8d9a-11ee-b677-5a4cf97d8a4d; _px2=eyJ1IjoiZTdiNzE3NDAtOGQ5YS0xMWVlLTkxNWEtMjJkZTZmNjFhOTk1IiwidiI6ImU3YTliYjI4LThkOWEtMTFlZS04MTI2LWQwYWYxNzUyODI5NyIsInQiOjYyMDIzMzg4MDAwNCwiaCI6IjVmODRiMDc4OTFiOWM3ZTQ2OWM2MmJjZjc4NzI1NmZhNjNhODMwMTIzMzczNDk0NGNjNDY2YmIxNGU5ZDAwMzQifQ==; _pxvid=e7a9bb28-8d9a-11ee-8126-d0af17528297; _px2=eyJ1IjoiZTdiNzE3NDAtOGQ5YS0xMWVlLTkxNWEtMjJkZTZmNjFhOTk1IiwidiI6ImU3YTliYjI4LThkOWEtMTFlZS04MTI2LWQwYWYxNzUyODI5NyIsInQiOjYyMDIzMzg4MDAwNCwiaCI6IjVmODRiMDc4OTFiOWM3ZTQ2OWM2MmJjZjc4NzI1NmZhNjNhODMwMTIzMzczNDk0NGNjNDY2YmIxNGU5ZDAwMzQifQ==; pxcts=e7eaeb42-8d9a-11ee-b677-5a4cf97d8a4d; _pxhd=12d4b5dcbc5ace0ae7e1fdb84439a7b7dbe1dce363eefefda1c3c8ffee5f1abd:e7a9bb28-8d9a-11ee-8126-d0af17528297"


    ,
           "cache-control": "no-cache", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"macOS\"",
           "sec-fetch-dest": "document", "sec-fetch-site": "none",
           "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",
           "pragma": "no-cache", "sec-fetch-mode": "navigate",
           "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"}
url = "https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-11-30&ADT=1&umnr=false&mon=true"

# cks = []
# for k, v in cookies.items():
#     cks.append(f'{k}={quote(v)}')
# headers['cookie'] = '; '.join(cks)
# headers['cookie'] = '_gcl_au=1.1.844575581.1700477194; _ga=GA1.1.705703545.1700477194; _pxvid=128f1e30-8792-11ee-b443-7061c4ff223f; pxcts=128f28dc-8792-11ee-b443-4e8857f971f4; _uetsid=129d89b0879211ee977771ce32cb65b6; _uetvid=129db280879211ee860d19abd0f03584; wisepops_visits=%5B%222023-11-20T10%3A46%3A33.550Z%22%5D; _tt_enable_cookie=1; _ttp=SUWxt4jqEaMrt1QTUoALn84Sjv4; _pin_unauth=dWlkPU5USXhPREF3WXpndE5qRTBOaTAwTW1aaUxUZ3hNR0V0Wm1NM05tRmxaalJtTTJVMg; _up=1.2.1708435651.1700477197; ORA_FPC=id=c98a5e29-4762-4b94-8d64-abd94c3da5d9; WTPERSIST=; wisepops=%7B%22csd%22%3A1%2C%22popups%22%3A%7B%22429858%22%3A%7B%22dc%22%3A1%2C%22d%22%3A1700477197690%7D%7D%2C%22sub%22%3A0%2C%22ucrn%22%3A36%2C%22cid%22%3A%2278471%22%2C%22v%22%3A4%2C%22bandit%22%3A%7B%22recos%22%3A%7B%7D%7D%7D; wisepops_session=%7B%22arrivalOnSite%22%3A%222023-11-20T10%3A46%3A33.550Z%22%2C%22mtime%22%3A1700477197690%2C%22pageviews%22%3A1%2C%22popups%22%3A%7B%22429858%22%3A0%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; _px2=eyJ1IjoiMTIzNzQwZDAtODc5Mi0xMWVlLWI5MDYtMTc3Y2I5NjUwMjE0IiwidiI6IjEyOGYxZTMwLTg3OTItMTFlZS1iNDQzLTcwNjFjNGZmMjIzZiIsInQiOjE3MDA0Nzc3NjA1MjcsImgiOiI0YWU4NDRjZTgyYmQ0ZWVhYmEzMjkyZjdiYTRhMWE2YzA2M2M4ZTA0YmQ3NzU2MTRiNWY5ZTcyNWY2MzA0MTRkIn0=; _ga_P2WLKWBNNW=GS1.1.1700477193.1.1.1700477480.58.0.0'

prox = 'http://user-uni001-region-us-sessid-1114-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
# prox = 'http://127.0.0.1:7890'
response = requests.post('http://52.52.23.116/tls/forward',
                         # response = requests.post('http://127.0.0.1:58000/tls/forward',
                         json=dict(url=url, method="GET", proxy=prox, headers=headers, debug=True)
                         )
# response = session.post(url, headers=h, data=data, proxy={
#     # 'http':'http://127.0.0.1:7890',
#     # 'https':'http://127.0.0.1:7890',
#     'http': prox,
#     'https':prox,
# })

print(response.json()['status_code'])
print(response.json()['text'])
# 冒泡排序
