import requests
import tls_client

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

headers = {
    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.95 Safari/537.36",
    "pragma": "no-cache", "referer": "https://www.flyfrontier.com/", "cache-control": "no-cache",
    "content-type": "application/json", "origin": "https://www.flyfrontier.com",

    "authority": "www.flyfrontier.com", "accept": "application/json, text/plain, */*", "accept-language": "en-US"}
url = "https://booking.flyfrontier.com/Flight/InternalSelect?o1=BNA&d1=ATL&dd1=Apr%2027,%202024&ADT=1&mon=true&promo="
cks = '_pxhd=6987a35b22308ab2d880577523a8618a7a67ddbf794d1c5f129ab7670e4794d6:7dee9538-1f10-11ef-8dfe-cccba3e35e09; _fbp=fb.1.1717138399757.1644415342; _gcl_au=1.1.1060131696.1717138407; _gid=GA1.2.1550978216.1717138592; _pin_unauth=dWlkPU1UazVORGhsT0RFdFpXVm1aUzAwTWpZMUxXRTRabUl0WXpRNE0yTTVZamN4TmpWaA; _pxvid=7b7e819a-1f1a-11ef-9f56-5ec26b64d4e3; _tt_enable_cookie=1; _ttp=iCnYndPMVBJ0OturIf5RPdFnlar; _up=1.2.1042276210.1717138402; cjConsent=MHxOfDB8Tnww; cjUser=26a68c5b-24f0-47d8-b4f1-4ccfefb5b61f; dtCookie=v_4_srv_3_sn_8032DDA1AC3159C6D43681767E15F48E_perc_100000_ol_0_mul_1_app-3Aea7c4b59f27d43eb_1; ORA_FPC=id=88d65269-3bff-4287-9be8-c920a845ce08; pxcts=7b7e9444-1f1a-11ef-9f56-0bf778f34b6f; WTPERSIST=; rxVisitor=1717143837183G4VRIGSTPG12F3QQ9LU7I4NGMRC61LQO; _ga_XXXX=GS1.1.1717143836.2.1.1717143840.0.0.489368694; _ga_P2WLKWBNNW=GS1.1.1717143815.2.1.1717143841.34.0.0; _ga=GA1.2.1101571915.1717138408; _pin_unauth=dWlkPU1UazVORGhsT0RFdFpXVm1aUzAwTWpZMUxXRTRabUl0WXpRNE0yTTVZamN4TmpWaA; _rdt_uuid=1717138592221.dcdd9d93-dbc4-4082-b9e4-124059eaecf6; _px2=eyJ1IjoiMjJmZjU4ODAtMWYyNy0xMWVmLTkwODQtYjU2ODg0ODUwN2JjIiwidiI6IjdkZWU5NTM4LTFmMTAtMTFlZi04ZGZlLWNjY2JhM2UzNWUwOSIsInQiOjYyMDIzMzg4MDAwNywiaCI6IjIzZmQ5YTFiZjUwZmJlYjljNGI1OWFkZTVjZmU2YzEwZDgyMTY0MmM2ZmM5ZmQzMjY4YWM1MGIwMmZlZmRkZGIifQ==; dtPC=3$543959628_447h1vKESFAKAAWLNUHKRDFFRWRBRNPSURTRMU-0e0; dtSa=-; rxvt=1717145759922|1717143837184'




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'
# prox = 'http://uni00002_custom_zone_US2_sid_4524195_time_5:FdkiGHty9a@us.ipwo.net:7878'
# print(prox)
# prox = 'http://uni00002_custom_zone_US2_sid_4428759_time_5:FdkiGHty9a@us.ipwo.net:7878'


for i in range(20):
    prox = 'http://127.0.0.1:7890'
    # url = "http://httpbin.org/ip"
    # response = requests.post('http://52.52.23.116/tls/forward',
    # response = requests.post('http://lcc.unififi.com/tls/forward',
    # response = requests.post('http://127.0.0.1:58000/tls/forward',
    response = requests.post('http://192.168.50.197:58000/tls/forward',

                             json={
            'url': 'https://booking.flyfrontier.com/Flight/InternalSelect?o1=BNA&d1=ATL&dd1=Apr%2027,%202024&ADT=1&mon=true&promo=',
            '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 (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",
                "sec-fetch-site": "same-site",
                "sec-fetch-mode": "navigate",
                "sec-fetch-user": "?1",
                "sec-fetch-dest": "document",
                "accept-language": "en",
                "cookie": cks
            },
            'allow_redirects': True,
            'debug': True,
            'method': "GET",
            'proxy': prox,
            'random_tls': True,

        }

                             )

    print(response.json())

    print(response.json()['status_code'])
    print('FlightData' in response.json()['text'])
    print(' has been denied', 'has been denied' in response.json()['text'])
