Commit d6f8ff5b authored by wang's avatar wang

开始按压验证码

parent 8ccbc087
......@@ -10,18 +10,18 @@
<body>
<script>
window._pxVid = '';
window._pxUuid = '66adae05-8c6a-11ee-82c6-2a9b4e968ac9';
window._pxUuid = '982547c4-8cd5-11ee-9632-eaca3e4be6dc';
window._pxAppId = 'PXVb73hTEg';
window._pxHostUrl = 'https://collector-PXVb73hTEg.perimeterx.net';
window._pxCustomLogo = '';
window._pxJsClientSrc = '//client.perimeterx.net/PXVb73hTEg/main.min.js';
window._pxFirstPartyEnabled = 'false';
var script = document.createElement('script');
script.src = '//captcha.perimeterx.net/PXVb73hTEg/captcha.js?a=c&u=66adae05-8c6a-11ee-82c6-2a9b4e968ac9&v=&m=0';
script.src = '//captcha.perimeterx.net/PXVb73hTEg/captcha.js?a=c&u=982547c4-8cd5-11ee-9632-eaca3e4be6dc&v=&m=0';
document.head.appendChild(script);
script.onerror = function () {
script = document.createElement('script');
script.src = 'https://captcha.px-cloud.net/PXVb73hTEg/captcha.js?a=c&u=66adae05-8c6a-11ee-82c6-2a9b4e968ac9&v=&m=0';
script.src = 'https://captcha.px-cloud.net/PXVb73hTEg/captcha.js?a=c&u=982547c4-8cd5-11ee-9632-eaca3e4be6dc&v=&m=0';
script.onerror = window._pxDisplayErrorMessage;
document.head.appendChild(script);
};
......
......@@ -66,7 +66,7 @@ class PxBypass():
prox = 'http://user-uni001-region-us-sessid-1111-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
# prox = 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:9000'
prox = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{random.randint(10000, 13500)}'
prox = 'http://127.0.0.1:7890'
# prox = 'http://127.0.0.1:7890'
session.proxies = {
'http': prox,
'https': prox,
......@@ -162,8 +162,7 @@ class PxBypass():
self._step_3()
time.sleep(2)
# self._token()
return self.header()
self._token()
def _init(self):
cks = '_px2=eyJ1IjoiOGRjYjQ3NjAtODl2jYi0xMWVlLTkwMmUtODE4MTcxMjRjOTBlIiwidiI6IjhlOGIyMGMzLTg5Y2ItMTFlZS05YWI1LTAwMjc4Njk4ZmY1ZiIsInQiOjYyMDIzMzg4MDAwNCwiaCI6Ijk4NjYzMWNkZDBmNTBjMWE5NjZjYjgwOGNlNzFjYTJkMWNkYzc2MjdjYTc4MTBlZDVhODdmN2FiMzYzOGU1OTgifQ==; pxcts=8e8b30eb-89cb-11ee-9ab5-ccabb13183c7; _px2=eyJ1IjoiOGRjYjQ3NjAtODljYi0xMWVlLTkwMmUtODE4MTcxMjRjOTBlIiwidiI6IjhlOGIyMGMzLTg5Y2ItMTFlZS05YWI1LTAwMjc4Njk4ZmY1ZiIsInQiOjYyMDIzMzg4MDAwNCwiaCI6Ijk4NjYzMWNkZDBmNTBjMWE5NjZjYjgwOGNlNzFjYTJkMWNkYzc2MjdjYTc4MTBlZDVhODdmN2FiMzYzOGU1OTgifQ=='
......@@ -330,10 +329,14 @@ class PxBypass():
# self.prox = f'http://user-uni001-region-us-sessid-{random.randint(1000, 5000)}-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
self.prox = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{random.randint(10000, 13500)}'
cks = []
s = set()
for k, v in self.cookies.items():
cks.append(f'{k}={v}')
if k not in s:
cks.append(f'{k}={v}')
s.add(k)
for k, v in self.session.cookies.get_dict().items():
cks.append(f'{k}={v}')
s.add(k)
print('; '.join(cks))
url = 'https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-11-30&ADT=1&umnr=false&mon=true'
response = requests.post('http://52.52.23.116/tls/forward',
......@@ -366,6 +369,8 @@ class PxBypass():
with open('index.html', 'w') as f:
f.write(response['text'])
print(response['status_code'])
if response['status_code'] == 302:
self.add_header()
def _step_2(self, nn):
......@@ -502,12 +507,16 @@ class PxBypass():
tmp[0]: tmp[1]
})
def header(self):
def add_header(self):
cks = []
s = set()
for k, v in self.cookies.items():
cks.append(f'{k}={v}')
if k not in s:
cks.append(f'{k}={v}')
s.add(k)
for k, v in self.session.cookies.get_dict().items():
cks.append(f'{k}={v}')
s.add(k)
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",
......@@ -525,7 +534,22 @@ class PxBypass():
"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": '; '.join(cks)
}
return headers
uri = 'http://ymx-lcc.unififi.com/header/add'
# uri = 'http://52.52.23.116/header/add'
# proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
# proxy = 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:10042'
# proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
brush_name = 'py1'
r = requests.post(uri, json={
'brush_fromto': 'LAS-BOS',
'brush_fromdate': '2023-05-26',
'brush_header': headers,
'brush_proxy': self.prox,
'brush_mode': 'shopping',
'brush_name': brush_name,
'brush_type': 'cookieF9',
})
self.log.info(f'添加接口 {r.text}')
if __name__ == '__main__':
......
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