Commit 72ea0e22 authored by wang's avatar wang

开始按压验证码

parent 9bdfc2ab
...@@ -377,7 +377,6 @@ class PxBypass(): ...@@ -377,7 +377,6 @@ class PxBypass():
for k, v in self.session.cookies.get_dict().items(): for k, v in self.session.cookies.get_dict().items():
cks.append(f'{k}={v}') cks.append(f'{k}={v}')
s.add(k) 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' 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', response = requests.post('http://52.52.23.116/tls/forward',
# response = requests.post('http://127.0.0.1:58000/tls/forward', # response = requests.post('http://127.0.0.1:58000/tls/forward',
...@@ -410,6 +409,9 @@ class PxBypass(): ...@@ -410,6 +409,9 @@ class PxBypass():
with open('index.html', 'w') as f: with open('index.html', 'w') as f:
f.write(response['text']) f.write(response['text'])
print(response['status_code']) print(response['status_code'])
self.session.cookies.update(
response['cookies']
)
if response['status_code'] != 403: if response['status_code'] != 403:
self.add_header() self.add_header()
...@@ -560,23 +562,16 @@ class PxBypass(): ...@@ -560,23 +562,16 @@ class PxBypass():
# if k not in s: # if k not in s:
# cks.append(f'{k}={v}') # cks.append(f'{k}={v}')
# s.add(k) # s.add(k)
for k, v in self.session.cookies.get_dict().items(): for k, v in self.session.cookies.get_dict().items():
cks.append(f'{k}={v}') cks.append(f'{k}={v}')
s.add(k) s.add(k)
print('; '.join(cks))
headers = { headers = {
"authority": "booking.flyfrontier.com", "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", "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", "accept-language": "en-US,en;q=0.9",
"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", "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) "cookie": '; '.join(cks)
} }
......
...@@ -5,18 +5,19 @@ import tls_client ...@@ -5,18 +5,19 @@ import tls_client
session = tls_client.Session(client_identifier='chrome_117') session = tls_client.Session(client_identifier='chrome_117')
headers = {"sec-fetch-site": "none", "sec-fetch-user": "?1", headers = {
"cookie": 'pxcts=a8b3a4b7-8dbf-11ee-837b-c0f06be4c4a6; _px2=eyJ1IjoiYTg0OGIwMzAtOGRiZi0xMWVlLWEwMGQtNzU4YzU4MGE4MjFjIiwidiI6ImE4YjM5NDNhLThkYmYtMTFlZS04MzdiLTNkNWY0OTRiZTAzNyIsInQiOjYyMDIzMzg4MDAwNCwiaCI6IjRiMDRiYzQwOTc2YTE1ZjkwNGZkNzU0Y2EyYmNiNTg2N2E1MjUzM2JjNzJmODMwZWE4NDVlMThiOGE4ZmQwOTUifQ==' "authority": "booking.flyfrontier.com",
,
"cache-control": "no-cache",
"sec-ch-ua": "\"Google Chrome\";v=\"117\", \"Not;A=Brand\";v=\"8\", \"Chromium\";v=\"117\"",
"sec-fetch-mode": "navigate", "upgrade-insecure-requests": "1", "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", "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-ch-ua-mobile": "?0", "accept-language": "en-US,en;q=0.9",
"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", "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",
"accept-language": "en-US,en;q=0.9", "pragma": "no-cache", "sec-fetch-dest": "document", "cookie": "_pxvid=0c1ef793-8dc2-11ee-91da-228dc1c257d4; pxcts=0c1f055f-8dc2-11ee-91da-a5735ff258e2; _px2=eyJ1IjoiMGIxYzRkMDAtOGRjMi0xMWVlLThhN2YtZjJhNzU0NzcyY2M1IiwidiI6IjBjMWVmNzkzLThkYzItMTFlZS05MWRhLTIyOGRjMWMyNTdkNCIsInQiOjYyMDIzMzg4MDAwNCwiaCI6ImVhYWZlMGVlOTZmYTNkYTEwMjE1ZGU2NDQxMTk4NTBjZTc5NWFlODlmZjIyMTZiNzY5ODkxZWQzZWU4MjRlYWUifQ==; ASP.NET_SessionId=4gt02ighp0k5r4ty4wh3iet3; _pxhd=775810c9fc376835be665fdfdf1f06dffa708f8cea2c10aa4af5c8ab0e9012b2:0c1ef793-8dc2-11ee-91da-228dc1c257d4; dotrez=!FgFe6N5gWZG0qguT9B3Zm8gW+yuktH8sD1YB8FqPTxitanvn/804bUKUpzB/3jqDJVrfklg9dZFZN/o="
"sec-ch-ua-platform": "\"macOS\""}
}
url = "https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-11-30&ADT=1&umnr=false&mon=true" url = "https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-11-30&ADT=1&umnr=false&mon=true"
......
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