import json
import random

import requests


headers = {
    "authority": "jbrest.jetblue.com",
    "accept": "application/json",
    "accept-language": "zh-CN,zh;q=0.9",
    "api-version": "v3",
    "application-channel": "Desktop_Web",
    "booking-application-type": "NGB",
    "cache-control": "no-cache",
    "content-type": "application/json",
    "origin": "https://www.jetblue.com",
    "pragma": "no-cache",
    "referer": "https://www.jetblue.com/booking/flights?from=LAS&to=BGI&depart=2023-09-22&isMultiCity=false&noOfRoute=1&lang=en&adults=1&children=0&infants=0&sharedMarket=false&roundTripFaresFlag=false&usePoints=false",
    "sec-ch-ua": "\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-site",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
}
uri = 'http://ymx-lcc.unififi.com/header/add'
proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
# r = requests.post(uri, json={
#     'brush_fromto': 'LAS-BOS',
#     'brush_fromdate': '2023-05-26',
#     'brush_header': headers,
#     'brush_proxy': proxy,
#     'brush_mode': 'shopping',
#     'brush_name': 'js',
#     'brush_type': 'headerB6',
# })
#
# print(r.text)

print(json.dumps({
    'brush_fromto': 'LAS-BOS',
    'brush_fromdate': '2023-05-26',
    'brush_header': headers,
    'brush_proxy': proxy,
    'brush_mode': 'shopping',
    'brush_name': 'js',
    'brush_type': 'headerB6',
}))