Commit 003b9702 authored by wang's avatar wang

1

parent 45b4c348
import json
import os
import time
import uuid
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED
import tls_client
import logging
import pathlib
import time
import traceback
from threading import Thread
import uuid
from concurrent.futures import ThreadPoolExecutor
import requests
from reese84_bypass import Reese84ByPass
import pathlib
from reese84_bypass import Reese84ByPass
root_logger = logging.getLogger()
......@@ -24,15 +21,18 @@ def check_pull():
get_url = 'http://ymx-lcc.unififi.com/header/task/pull/cookieY4?brush_name=test'
r = requests.get(get_url)
return r.json()
def get_proxy():
get_proxy_url = 'http://ymx-lcc.unififi.com/proxy/get-proxy'
r = requests.post(get_proxy_url, json={
'name': 'Y4',
'type':'shopping'
'name': 'TR',
'type': 'shopping'
})
return r.json()
def add_header(headers:dict, cookies: dict, px: str, thread_id=0):
def add_header(headers: dict, cookies: dict, px: str, thread_id=0):
cks = []
for k, v in cookies.items():
cks.append(f'{k}={v}')
......@@ -41,17 +41,19 @@ def add_header(headers:dict, cookies: dict, px: str, thread_id=0):
"brush_fromdate": "2023-06-19",
"brush_fromto": "BOS-JFK",
"brush_header": headers,
"brush_name": f"rever_{thread_id}",
"brush_name": f"reverse_{thread_id}",
"brush_proxy": px,
"brush_type": "cookieY4"
"brush_type": "cookieTR"
}
r = requests.post("http://ymx-lcc.unififi.com/header/add", json=data)
print(r.json())
def exec(thread_id):
id_ = uuid.uuid4().hex
try:
px = get_proxy()['url']
cf = Reese84ByPass(target="https://www.volaris.com/", proxy=px, thread_name=f'{thread_id}')
cf = Reese84ByPass(target="https://www.flyscoot.com/", proxy=px, thread_name=f'{thread_id}')
headers, cookies = cf.start()
# cf.test()
add_header(headers, cookies, px, thread_id)
......@@ -61,6 +63,7 @@ def exec(thread_id):
print(e)
traceback.print_exc()
def run():
brush_thread = 1
while True:
......@@ -93,16 +96,5 @@ def run():
objs[n] = task
if __name__ == '__main__':
run()
......@@ -37,7 +37,7 @@ class Reese84ByPass(object):
self._init()
self._repare_js()
self.__auth_token()
self._test()
# self._test()
# time.sleep(random.randint(3,5))
# self.__get_session_token()
......@@ -79,7 +79,6 @@ class Reese84ByPass(object):
datas = output.decode().split('\n')
else:
raise Exception("执行 JS 超时")
print(filename)
self.log.log('VMJS', f'执行JS: cost:{(time.time() - t2):.3f}s')
data = json.loads(open(filename,'r').read())
......@@ -134,8 +133,6 @@ class Reese84ByPass(object):
url = "https://ibe.api.flyscoot.com/v1/account/anonymous"
response = self._session.get(url, headers=headers)
print(response.text)
print(response)
self._token = response.json()['data']['accessToken']
self.log.log('REQU', f'__auth_token: code:{response.status_code} cost:{(time.time() - t1):.3f}s')
......@@ -227,8 +224,6 @@ class Reese84ByPass(object):
data = json.dumps(data, separators=(',', ':'))
response = self._session.post(url, headers=headers, data=data)
print(response.text)
print(response)
if __name__ == '__main__':
......
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