import random

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)}'
cks = '_pxvid=8a03a16b-8521-11ee-a3bf-ecacdfb43743; pxcts=8a03b045-8521-11ee-a3bf-e922253e740e; _px2=eyJ1IjoiOTg0ZjIzYjItYmMyOC00MmZjLTgyODAtYzE2YTY3ODdkYWJlIiwidiI6IjhhMDNhMTZiLTg1MjEtMTFlZS1hM2JmLWVjYWNkZmI0Mzc0MyIsInQiOjYyMDIzMzg4MDAwNCwiaCI6IjVlZmNkMjRjMjA1NDNlZjMxMTEzODhiZWFjNjcwNDhjNTM4ZWVjYTQxMTg4YzNhYTFlNDhkNDRjYWUxZGYyNzkifQ=='



url = 'https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-11-30&ADT=1&umnr=false&mon=true'
response = session.post('http://52.52.23.116/tls/forward',
                         json=dict(url=url, 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",
                             "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": "none",
                             "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",
                             "cookie": cks
                         }, method="GET", proxy=prox, debug=True
                                   # ,allow_redirects=True
                                   ))
response = response.json()
print(response['status_code'])
print(response['text'])