#

import tls_client

session = tls_client.Session(client_identifier='chrome_117',
                             header_order=['Host', 'content-type', 'accept', 'accept-language', 'authority',
                                           'cache-control', 'pragma', 'sec-ch-ua', 'sec-ch-ua-mobile',
                                           'sec-ch-ua-platform', 'sec-fetch-dest', 'sec-fetch-mode', 'sec-fetch-site',
                                           'sec-fetch-user', 'upgrade-insecure-requests', 'user-agent']
                             )
px = 'http://127.0.0.1:7890'
session.proxies = {
    'http': px,
    'https': px,
}
session.proxies = {
    'http': "http://user-uni007-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600",
    'https': "http://user-uni007-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600",
}
session.proxies = {
    'http': 'http://127.0.0.1:8890',
    'https': 'http://127.0.0.1:8890',
}
# session.proxies = {
#     'http': 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:9000',
#     'https': 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:9000',
# }
# headers, cookies = \
headers = {
    "Host": "makeabooking.flyscoot.com",
    "content-type": "application/json",
    "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",
    "authority": "makeabooking.flyscoot.com",
    "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"
}
cookies = {
    "reese84": "3:Si0Up4jkEM8fUeP91T1GQw==:ofLeQ/PsemSvgokV6nkqxuV5Z8hFIb4cIyBjMpuM9Q3s+D2dV02OZN76u4UYMJrgyUvYmgofdQmXNCMKcqJuBqkf4qzBFXIDGH0Iz5guYndg+5l20GH0aJkh4QtzwZtpPiOnyKJWjOZ6aN0RHIY2WVZenCJEPlBcILh8Z/JlwBFmGyQx1Wbi4HLUpXYaAU2hEqJp575+QGdeO6j+0o0ytSYWyUaxQQF/dRzqw0xO9gNmpMMiC0F+y8XuSKIYi7iNeRDlOawqZSYQ/56polcPz+sXDJX3bo0c0uIfP00GbaGOzGZ3YxKpDxvrWsU6mOdUN2Jc4+zQP78Uzw0tYVZxAgFiF1G3PC/dJ/GXOqvLnxd6u8WtP0EzN9pWYEu6MXbaYS2UNYPq9j8uFZegHsfRa6RuAjj4CgM4ho3Qd/dCoksEV79/Qc6/WI96Nmo56dgjIjYQcdrnET+WKb5LVrPtHw==:1Z+cYm5mj56uXonP1/bIPDpixbdTZEGjGNUTo/ilSd4=",
    "incap_ses_138_2444946": "G/EtdmXm+xOa3k4gVUbqAYKYaWUAAAAAw9g/RVtiYKVh7YCEuPjgBA==",
    "nlbi_2444946_2147483392": "bIV6XlnXlHuGXnNBbmwDOgAAAAAUVoWrKQNbR12uLWe6DC/h",
    "visid_incap_2444946": "dCfsyHpnRGODIDByjrHguoKYaWUAAAAAQUIPAAAAAABEhkcJLPVjhQoVYLUOYfmg"
}

url = "https://makeabooking.flyscoot.com/Book/Flight?culture=en-SG&type=oneway&dst1=SIN&ast1=ADL&dst2=ADL&ast2=SIN&dd=2023-12-15&rd=null&adt=1&chd=0&inf=0#"
url = "https://makeabooking.flyscoot.com/Book/Flight"
params = {
    "culture": "en-SG",
    "type": "oneway",
    "dst1": "SIN",
    "ast1": "ADL",
    "dst2": "ADL",
    "ast2": "SIN",
    "dd": "2023-12-15",
    "rd": "null",
    "adt": "1",
    "chd": "0",
    "inf": "0"
}
response = session.get(url, headers=headers, cookies=cookies, params=params)
print(response.url)
print(response.text)
print(response)

# import requests
#
# request_data = {
#     "service_name": "lcc-tls-forward",
#     "source_url": "http://39.106.6.97:88/svn/develop/lcc-catcher/lcc-tls-forward-1.0.1.jar",
#     "cur_version": "1.0.1",
#     "upgrade": "ON",
#     "force_upgrade": "OFF",
#     "upgrade_method": "serial",
#     "environment": ["prod"]
# }
# request_url = "http://47.102.111.131:8083/api/v1/service/upgrade"
#
# res = requests.post(url=request_url, json=request_data)
# print(res.text)
