import requests
import tls_client

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

headers = {
  'Host': 'booking.flyfrontier.com',
  'upgrade-insecure-requests': '1',
  'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
  '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',
  'cookie': '_pxvid=694eb30a-a54a-11ee-9983-ba7a378a394d; pxcts=694f492a-a54a-11ee-9984-2fa97b2fd312; _px2=eyJ1IjoiNjkxYTJjNzAtYTU0YS0xMWVlLThmMWMtM2YzZDgzNzU0NGRhIiwidiI6IjY5NGViMzBhLWE1NGEtMTFlZS05OTgzLWJhN2EzNzhhMzk0ZCIsInQiOjE3MDM3NDUyNTM0NzEsImgiOiI0NGU3NGRhYzdlOGI1ZGI2NWQ3YTJlYWU3YTE2MDEzNjIyNGNkZTI5ODE5NWY0YmMzNThjOTkxOTNkYTlhMGIxIn0='
}
url = "https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-11-30&ADT=1&umnr=false&mon=true"

prox = 'http://user-uni001-region-us-sessid-1114-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
# prox = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{random.randint(10000, 13500)}'
# prox = 'http://user-uni001-region-us-sessid-4909-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
# prox = 'http://74.48.159.194:33080'
# print(prox)


for i in range(20):
    # prox = 'http://127.0.0.1:8890'
    # url = "http://httpbin.org/ip"
    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,
                                       allow_redirects=True
                                       )

                             )

    print(response.json())

    print(response.json()['status_code'])
    print('FlightData' in response.json()['text'])
