import random

import requests
import tls_client

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

prox = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{random.randint(10000, 13500)}'
#     // prox = `http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:${randint(10000, 13500)}`
# prox = 'http://uni00001_custom_zone_US_sid_67336720_time_5:q39CEBTs5A@us.foxyip.com:7778'
prox = 'http://user-uni001-region-us-sessid-1111-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
# prox = 'http://uni00001_custom_zone_US_sid_67336723_time_5:q39CEBTs5A@us.foxyip.com:7778'


# prox = 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:12019'
cks = 'px2=eyJ1I11joiMGI3ZTQwZjAtYTEzYi0x23123MWVlLWE3ZTctYjU1Njk2NDc0ODExIiwidiI6IjBiZmRhMWZiLWExM2ItMTFlZS1hNDM4LTg0NTQ3ZjI1MTRhMSIsInQiOjE3MDMyOTg4NTAxNjMsImgiOiIxZjc4OTM2224YmE0OTFlMTBjNWFmMWNmYzZlMjljMTdjNGIyYzc5MDY3MTVlYjMwZmE3M2ZlYzQ0YjA0NTBkMWU0In0='

cks = '_px2=eyJ1IjoiMmQyNWU3YTAtYWY5OS0xMWVlLWE2ZWEtZjE4ZjkxOTE0MjdmIiwidiI6IjJkN2Y4NGY5LWFmOTktMTFlZS1hYWRjLTg0OWI1ZGE0ZjcyMiIsInQiOjE3MDQ4Nzg1OTQ4ODMsImgiOiJmYzJjZDJjNmIzMzBhOGE0ZjAyNzVmNGZiNmEyZGRlNWEwODEyZjI5M2JlYjBiMTc2YTQzZDY3MGY1NzNhOTlhIn0=; _pxvid=2d7f84f9-af99-11ee-aadc-849b5da4f722'
# cks = ''






url = 'https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-12-30&ADT=1&umnr=false&mon=true'
response = requests.post('http://52.52.23.116/tls/forward',
                         json=dict(url=url, headers={
                             "Host": "booking.flyfrontier.com",
                             "sec-ch-ua": "\"Not_A Brand\";v=\"8\", \"Chromium\";v=\"120\", \"Google Chrome\";v=\"120\"",
                             "sec-ch-ua-mobile": "?0",
                             "sec-ch-ua-platform": "\"macOS\"",
                             "upgrade-insecure-requests": "1",
                             "user-agent": 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Mobile/15E148 Safari/604.1',
                             "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",
                             "sec-fetch-site": "none",
                             "sec-fetch-mode": "navigate",
                             "sec-fetch-user": "?1",
                             "sec-fetch-dest": "document",
                             "accept-language": "en",
                             "cookie": cks
                         }, method="GET", proxy=prox, debug=True
                                   , allow_redirects=True,random_tls=True
                                   ))
response = response.json()
print(response)
print(response['status_code'])
print(response['text'])
with open('index.html', 'w') as f:
    f.write(response['text'])
