Commit d2a4ce9e authored by wang's avatar wang

对比修复

parent 7c52e49d
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<script src="./replacer.js"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
chrome.webRequest.onBeforeRequest.addListener(
function(details, callback) {
// 修改请求的 URL
if (details.url.indexOf('example.com') != -1) {
details.url = 'http://www.example.com/';
}
// 继续处理请求
callback({cancel: false, redirectUrl: details.url});
},
{urls: ['<all_urls>']},
['blocking']
);
\ No newline at end of file
{
"name": "text",
"version": "0.0.0",
"description": "text",
"permissions": ["unlimitedStorage",
"activeTab",
"webRequest",
"webRequestBlocking",
"tabs",
"debugger",
"storage",
"contextMenus",
"http://*/*",
"https://*/*",
"<all_urls>",
"cookies",
"downloads",
"proxy"
],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
"browser_action": {
"default_popup": "popup.html"
},
"background": {
"page": "background.html",
"persistent": true
},
// "chrome_url_overrides": {
// "newtab": "new_tab_overwrite.html"
// },
"manifest_version": 2
}
chrome.webRequest.onBeforeRequest.addListener(
function (details) {
// 在这里修改请求的 URL
if (details.url.indexOf('outbound') != -1) {
details.url = 'http://www.example.com/';
}
return {cancel: false, redirectUrl: details.url};
},
{urls: ['<all_urls>']},
['blocking']
);
chrome.webRequest.onBeforeSendHeaders.addListener((details) => {
console.log(details.requestHeaders.map(e => {
return e.name
}) + '')
let res = [];
const needOrigin = details.requestHeaders.map(v => {
if (v.name.indexOf('X-1ItxWO9i') > -1) {
res.push(v);
}
})
let t = parseInt(Math.random() * 1500) + 10000
let proxy = `http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:${t}`
let body = {
"brush_fromto": "LAS-BOS",
"brush_fromdate": "2023-05-26",
"brush_header": {
"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",
"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"
},
"brush_proxy": proxy,
"brush_mode": "shopping",
"brush_name": "js",
"brush_type": "headerB6"
}
for (let i = 0; i < res.length; i++) {
body.brush_header[res[i].name] = res[i].value
}
if (res.length > 0) {
fetch("http://ymx-lcc.unififi.com/header/add", {
"headers": {
"accept": "application/json",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6",
"api-version": "v3",
"application-channel": "Desktop_Web",
"booking-application-type": "NGB",
"cache-control": "no-cache",
"content-type": "application/json",
"pragma": "no-cache",
"sec-ch-ua": "\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-site",
"x-auth-token": "7d66f40f-77e5-4857-b0f5-1a2bbd16427a",
"x-b3-spanid": "1694597336668",
"x-b3-traceid": "fa70f4c5a0583941"
},
"referrerPolicy": "no-referrer-when-downgrade",
"body": JSON.stringify(body),
"method": "POST",
"mode": "cors",
"credentials": "omit"
}).then(r => {
return r.text()
}).then(r => {
console.log(r)
})
}
}, {
urls: ["<all_urls>"],
types: ["xmlhttprequest"]
}, ["blocking", "requestHeaders", "extraHeaders"])
\ No newline at end of file
...@@ -65,8 +65,8 @@ for i in range(100): ...@@ -65,8 +65,8 @@ for i in range(100):
proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}' proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
# proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@198.147.25.26:{int(random.randint(10000, 11149))}' # proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@198.147.25.26:{int(random.randint(10000, 11149))}'
proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600' proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
if platform.uname().system == 'Darwin': # if platform.uname().system == 'Darwin':
proxy = 'http://127.0.0.1:7890' # proxy = 'http://127.0.0.1:7890'
tlsV = f'chrome_{random.randint(105, 113)}' tlsV = f'chrome_{random.randint(105, 113)}'
tlsV = 'chrome_114' tlsV = 'chrome_114'
session = tls_client.Session(tlsV) session = tls_client.Session(tlsV)
......
This diff is collapsed.
This diff is collapsed.
import tls_client import json
import random
session = tls_client.Session(client_identifier='chrome_112') import requests
url = "https://jbrest.jetblue.com/lfs-rwb/outboundLFS"
data = {
"tripType": "oneWay",
"from": "LAS",
"to": "BOS",
"depart": "2023-09-10",
"cabin": "economy",
"refundable": False,
"dates": {
"before": "3",
"after": "3"
},
"pax": {
"ADT": 1,
"CHD": 0,
"INF": 0,
"UNN": 0
},
"redempoint": False,
"pointsBreakup": {
"option": "",
"value": 0
},
"isMultiCity": False,
"isDomestic": False
}
# proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
proxy = 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:10730'
# proxy = 'http://127.0.0.1:7890'
session.proxies = {
'http': proxy,
'https': proxy,
}
# print(proxy)
headers = {'Host': 'jbrest.jetblue.com', 'application-channel': 'Desktop_Web', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36', 'booking-application-type': 'NGB', 'content-type': 'application/json', 'accept': 'application/json', 'origin': 'https://www.jetblue.com', 'accept-language': 'en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7', 'x-1itxwo9i-f': 'A07o0m-KAQAAvLNQXGE1DNe5ZQJtnuQNm_AwNeULaanncTR8HcQJ-EsmopuKAcJoklj6K21wobReCOfvosJeCA==', 'x-1itxwo9i-b': '-wji0rp', 'x-1itxwo9i-c': 'AOBD0W-KAQAAoS3d2kJmCpf3c4Au_-kJDnR47ZZPixCQ0WlU1snZKppIdbE3', 'x-1itxwo9i-d': 'ABaAhIjBCKHFgQGAAYIQgISi0aIA5JmBzvpDzz8Aydkqmkh1sTcAAAAAH29cNgAMzy14CdgPSoAaMDzAAfaK', 'x-1itxwo9i-z': 'q', 'x-1itxwo9i-a': '_OctJxDkUUWAgD_f06reQZX-dqg6yeWr7ioJsg4CIaL4anmuuaZEKNHZ=NWp8Lnv71Tiuqqs7K8lpFq3E4bCOa5QVNl89OEPgYs7MGQB_kkRdxc-vqmF5X5ux9MPGAt9Dcd_DFsanCHqfyFa8Mg3Y7xdE760vuGruM0rfa1660tVH_FoVO4HWSU-iHg1JOkeBsb3NxPUz0AThodm01vTgJWhRUyg=KywalLxw7SWERnAsEvmfqMVJNICh1nMLLBwKJ0-bFurLIke-KYvSv-jHyn3fPXEyP7hkwNm5tvlHJqP1COICV-o3ycnP9asYuiG=04a9cJtU6f=831EJ0mfWR9HXMkfWCwao8ga4QIB=g9to6m3dtnrnMmJ=vAxkvIVL-hcZOzh5xaBuv_KzRvaxRbcfm1T_9TTTZEFy9enFYzsyV0O5-T9rul0CXzF=RTXhqkG__VgSnwDnD5O=f03ZbCqkpmEZQVvFnY6lpxzEFMsqst0XQ=vuzxGtD=qUe7dmrV_ArCLZ6R=L7Oso4zxLYtJSa=wu1jmwnKS-DiBG6d4Aqo3Dqx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qUqr3oG-8s99l--Rqq'}
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)
response = session.post(url, headers=headers, json=data) print(json.dumps({
'brush_fromto': 'LAS-BOS',
print(response.text) 'brush_fromdate': '2023-05-26',
'brush_header': headers,
'brush_proxy': proxy,
'brush_mode': 'shopping',
'brush_name': 'js',
'brush_type': 'headerB6',
}))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment