Commit 077bfe23 authored by wangmingming's avatar wangmingming

wn比较稳定

parent 4924db5f
...@@ -2,7 +2,7 @@ FROM python:3.10.1-slim-bullseye ...@@ -2,7 +2,7 @@ FROM python:3.10.1-slim-bullseye
RUN mkdir -p "/home/opt/lcc-wn" RUN mkdir -p "/home/opt/lcc-wn"
RUN apt update &&apt install curl -y RUN apt update &&apt install curl -y
RUN pip3 install requests loguru curl_cffi tls_client pyquery nacos-sdk-python pyyaml pymongo RUN pip3 install requests loguru curl_cffi tls_client pyquery nacos-sdk-python pyyaml pymongo
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt install nodejs -y RUN apt install nodejs -y
WORKDIR /home/opt/lcc-wn/ WORKDIR /home/opt/lcc-wn/
RUN apt install -y make g++ RUN apt install -y make g++
......
...@@ -43,19 +43,35 @@ print(len(envs)) ...@@ -43,19 +43,35 @@ print(len(envs))
# session = requests.session() # session = requests.session()
headers = { headers = {
"Host": "www.southwest.com", "authority": "www.southwest.com",
"x-channel-id": "southwest",
# "x-app-id": "air-booking",
# "x-swa-di-pid": "6220143449988117",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"content-type": "application/json",
"accept": "application/json, text/javascript, */*; q=0.01", "accept": "application/json, text/javascript, */*; q=0.01",
"x-api-key": "l7xx944d175ea25f4b9c903a583ea82a1c4c", "accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6",
"cache-control": "no-cache",
"content-type": "application/json",
# "ee30zvqlwf-a": "hTGMXafTzv2PfXbe_AY1Qkn8IuOmoRMR3Yh26sw-zc1x=URAL_NjXURwnMjr=M5euHEBOSzi8tniqBESpKvNKChOKjRp5hCoPOAXzv8fy7gU=PPwj=WnHlkTiQL-uGbyN=yAgyt_7F69MXB0rL9Ykyg7wF8r6z7y0vX_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aF4UzO6T60dbnrmqS8zWw-gIFhQTueWVv1nDPTCgw39Zk4T29RejF5GOtV6z-37FmFHzMPbqo9iucYtt_0R0LIXQOb1qiRNsTzIr76CfVkZqRmLBwU6abtBI8cWtgYdNNOHSaMkG-rej8wVOHD91XWB7DjxX89D21uXrGf2FxIXCHtCfpRlXxIWoznZGWk_3_bDs6-LmQ2zgdS9SXQeqNcjd6pA0pvt14celeUmrcVC6kUoTDlsklKLVbNwZn2PoW1YHHP=gKRgjRnQAcNM70d87MBc09egVxF8qAGGwBvqvdF3TnEgt8Bv7YkYCZ5CtuTur_AZzFAbcLPRtyyXntqd5jBRFGl6Uqy8OQLgRpcwsShpwb1hY=qny6rYydgcLIWIDw-9AlKMNXuPMSqQaUfZeWC7Y2m-jUpZ1DBWZPjCNh8jo56gLXL8KQlmtbnKu6pADjv-lgKXA-ltTF3riZQdyARXP2Cqk_OVx8olMTYtcSIEutBCrmoLzyUiH97C4f=pfaRUBcSUAdHbFsK-wiSpNB=SBCXNfYDRG3",
# "ee30zvqlwf-b": "4ih8bw",
# "ee30zvqlwf-c": "AAAVF4KMAQAAIjh8ZUHWFh_dXPGoIB5nyDQCVIWEDYjClQpQK7Z0MG51WSS4",
# "ee30zvqlwf-d": "ABaAhIDBCKGFgQGAAYIQgISigaIAwBGAzvpizi_33we2dDBudVkkuAAAAABnMdsJAEskk19wkWHrMAo_h-nxK_s",
# "ee30zvqlwf-f": "AzQRG4KMAQAA3sP_kq2I3xtte3phkhRNbYJgTSgioyQ9zCzyMSvEUjJby6YpAReeaPauchRAwH9eCOfvosJeCA==",
# "ee30zvqlwf-z": "q",
"origin": "https://www.southwest.com", "origin": "https://www.southwest.com",
"sec-fetch-site": "same-origin", "pragma": "no-cache",
"sec-fetch-mode": "cors", "sec-ch-ua": "\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Google Chrome\";v=\"114\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "empty", "sec-fetch-dest": "empty",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6" "sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"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",
"x-api-key": "l7xx944d175ea25f4b9c903a583ea82a1c4c",
"x-app-id": "air-booking",
"x-channel-id": "southwest",
"x-swa-di-dtid": "null",
"x-swa-di-pid": "undefined",
"x-swa-di-ue": "",
"x-swa-di-uid": "undefined",
"x-swa-di-usid": "undefined",
# "x-user-experience-id": "094ff7f7-a044-4b53-973a-b9e4a9374001"
} }
# tlss = [ 'chrome_103', 'chrome_104', 'chrome_105', 'chrome_106', # tlss = [ 'chrome_103', 'chrome_104', 'chrome_105', 'chrome_106',
# 'firefox_102', 'firefox_104' # 'firefox_102', 'firefox_104'
...@@ -93,25 +109,25 @@ while True: ...@@ -93,25 +109,25 @@ while True:
proxy2 = f'http://user-uni003-region-us-sessid-${random.randint(1000,5000)}-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600' proxy2 = f'http://user-uni003-region-us-sessid-${random.randint(1000,5000)}-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
# 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'
proxy = random.choice([proxy1, proxy2])
tlsV = f'chrome_{random.randint(105, 113)}' tlsV = f'chrome_{random.randint(105, 113)}'
proxy = random.choice([proxy1, proxy2])
logger.info(f"success:{success} proxy: {proxy} ") logger.info(f"success:{success} proxy: {proxy} ")
tlsV = 'chrome_112' tlsV = 'chrome_112'
# session = requests.Session(impersonate='chrome110') session = requests.Session()
session = tls_client.Session(tlsV) # session = tls_client.Session(tlsV)
# session.timeout_seconds = 15 # session.timeout_seconds = 15
# session = requests.session() # session = requests.session()
session.proxies = { # session.proxies = {
'http': proxy, # 'http': proxy,
'https': proxy, # 'https': proxy,
} # }
if platform.uname().system == 'Darwin': # if platform.uname().system == 'Darwin':
session.proxies = { # session.proxies = {
'http': 'http://127.0.0.1:9001', # 'http': 'http://127.0.0.1:8890',
'https': 'http://127.0.0.1:9001', # 'https': 'http://127.0.0.1:8890',
} # }
selectId = random.choice(list(envs)) selectId = random.choice(list(envs))
...@@ -129,7 +145,7 @@ while True: ...@@ -129,7 +145,7 @@ while True:
'update_time': int(time.time() * 1000) 'update_time': int(time.time() * 1000)
}) })
code = open('src.js', 'r', encoding='utf-8').read() code = open('src.js', 'r', encoding='utf-8').read()
with open('src_run2.js', 'w', encoding='utf-8') as f: with open('src_run1.js', 'w', encoding='utf-8') as f:
f.write(code + '\n\n' + c f.write(code + '\n\n' + c
+ +
';;;\n\n' + ''' ';;;\n\n' + '''
...@@ -145,7 +161,9 @@ while True: ...@@ -145,7 +161,9 @@ while True:
//print(JSON.stringify(xhr.headers)) //print(JSON.stringify(xhr.headers))
//_process.exit(0) //_process.exit(0)
setTimeout(r=> { setTimeout(r=> {
var xhr = new XMLHttpRequest(); var
xhr = new
XMLHttpRequest();
xhr.open('POST', xhr.open('POST',
"https://www.southwest.com/api/air-booking/v1/air-booking/page/air/booking/shopping", "https://www.southwest.com/api/air-booking/v1/air-booking/page/air/booking/shopping",
false); false);
...@@ -173,7 +191,7 @@ setTimeout(r=> { ...@@ -173,7 +191,7 @@ setTimeout(r=> {
# p = subprocess.Popen(['node', 'js_dom_run1.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, # p = subprocess.Popen(['node', 'js_dom_run1.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
# p = subprocess.Popen(['node', 'src_run_chrome_105.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE, # p = subprocess.Popen(['node', 'src_run_chrome_105.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
# p = subprocess.Popen(['node', 'src_run_company_chrome.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE, # p = subprocess.Popen(['node', 'src_run_company_chrome.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
p = subprocess.Popen(['node', 'src_run2.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE, p = subprocess.Popen(['node', 'src_run1.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
output, err = p.communicate(timeout=10) output, err = p.communicate(timeout=10)
tmp = '' tmp = ''
...@@ -218,11 +236,9 @@ setTimeout(r=> { ...@@ -218,11 +236,9 @@ setTimeout(r=> {
# #
# if platform.uname().system == 'Darwin': # if platform.uname().system == 'Darwin':
total += 1 total += 1
response = session.post(url, headers=headers, json=data) # response = session.post(url, headers=headers, json=data)
logger.info(f'tls:{tlsV} proxy:{proxy} res:: {response.status_code}') # logger.info(f'tls:{tlsV} proxy:{proxy} res:: {response.status_code}')
# status_code = 400 status_code = 400
status_code = response.status_code
print(response.text)
if status_code != 403: if status_code != 403:
success += 1 success += 1
uri = 'http://ymx-lcc.unififi.com/header/add' uri = 'http://ymx-lcc.unififi.com/header/add'
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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