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 = '_gcl_au=1.1.1251135220.1700320405; _gid=GA1.2.2042528071.1700320405; _fbp=fb.1.1700320407060.548909310; _tt_enable_cookie=1; _ttp=AvoJoW18xGo_yWwWbT0o6ygK2wl; pxcts=07daf97a-8625-11ee-a321-a9fe8b8e7157; _pxvid=07dae870-8625-11ee-a321-be24495c1670; _up=1.2.2012479227.1700320410; _pin_unauth=dWlkPU5qWmlNMlEwT0RVdE5qQmlNQzAwT0RNMkxUZzVOMkV0TTJNeFlqWTVZemxsTVRSag; _gat_UA-2678252-1=1; _ga_P2WLKWBNNW=GS1.1.1700320404.1.1.1700320511.60.0.0; _ga=GA1.1.1166546209.1700320405; wisepops_visits=%5B%222023-11-18T15%3A15%3A02.606Z%22%5D; _uetsid=44980cb0862511eeb3c26f174accc4ff; _uetvid=449822b0862511ee89171d5330bbfbd9; wisepops=%7B%22csd%22%3A1%2C%22popups%22%3A%7B%22429858%22%3A%7B%22dc%22%3A1%2C%22d%22%3A1700320523563%7D%7D%2C%22sub%22%3A0%2C%22ucrn%22%3A8%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-18T15%3A15%3A02.606Z%22%2C%22mtime%22%3A1700320523564%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=eyJ1IjoiM2YyMzY0MjAtODYyNS0xMWVlLWE1NDQtY2QzMjdkZGQ5NzNlIiwidiI6IjA3ZGFlODcwLTg2MjUtMTFlZS1hMzIxLWJlMjQ0OTVjMTY3MCIsInQiOjYyMDIzMzg4MDAwNywiaCI6ImQ5YTIyMGYwMWM2YWNkOTIyZDBiYWYxNjFiZGExZTA4NjNlNzgzODY0MjY4ZjgxOTA1NTc4YTI0NGVjZThlMmEifQ=='


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'])