Commit 6c07b636 authored by wang's avatar wang

1

parent 2d7eaa35
Pipeline #449 canceled with stages
...@@ -27,24 +27,7 @@ def get_proxy(): ...@@ -27,24 +27,7 @@ def get_proxy():
}) })
return r.json() return r.json()
def add_header(cookies: dict, px: str, thread_id=0): def add_header(headers:dict, cookies: dict, px: str, thread_id=0):
headers = {
"Host": "www.allegiantair.com",
"pragma": "no-cache",
"cache-control": "no-cache",
"sec-ch-ua": "\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Google Chrome\";v=\"114\"",
"sec-ch-ua-mobile": "?0",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"content-type": "application/json",
"accept": "*/*",
"x-apollo-operation-name": "flights",
"sec-ch-ua-platform": "\"macOS\"",
"origin": "https://www.allegiantair.com",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7"
}
cks = [] cks = []
for k, v in cookies.items(): for k, v in cookies.items():
cks.append(f'{k}={v}') cks.append(f'{k}={v}')
...@@ -64,9 +47,9 @@ def exec(thread_id): ...@@ -64,9 +47,9 @@ def exec(thread_id):
try: try:
px = get_proxy()['url'] px = get_proxy()['url']
cf = Reese84ByPass(target="https://www.allegiantair.com/", proxy=px, thread_name=thread_id) cf = Reese84ByPass(target="https://www.allegiantair.com/", proxy=px, thread_name=thread_id)
cookies = cf.start() headers, cookies = cf.start()
# cf.test() # cf.test()
add_header(cookies, px, thread_id) add_header(headers, cookies, px, thread_id)
# except json.decoder.JSONDecodeError: # except json.decoder.JSONDecodeError:
# print('json huoqu shibai ') # print('json huoqu shibai ')
except Exception as e: except Exception as e:
......
## Reese84 破解
```angular2html
需要保持 UA一致
```
\ No newline at end of file
...@@ -163,8 +163,7 @@ class Reese84ByPass(object): ...@@ -163,8 +163,7 @@ class Reese84ByPass(object):
"Origin": "https://www.volaris.com", "Origin": "https://www.volaris.com",
"Referer": "https://www.volaris.com/", "Referer": "https://www.volaris.com/",
"Accept-Language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6", "Accept-Language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6",
"cookie": self.__session.cookies.get_dict() }, self.__session.cookies.get_dict()
}
if __name__ == '__main__': 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