| | |
| | | from strategy import basic_methods |
| | | |
| | | from strategy.logging_config import get_logger |
| | | from trade import middle_api_protocol |
| | | from utils import hx_qc_value_util |
| | | |
| | | # 获取logger实例 |
| | |
| | | DABAN_TYPE_EVER_LIMIT_DOWN = 5 |
| | | |
| | | |
| | | def __base_request(url, data): |
| | | headers = { |
| | | "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", |
| | | "User-Agent": "Dalvik / 2.1.0(Linux;U;Android 6.0.1;MuMu Build/V417IR)" |
| | | } |
| | | # proxies={'https': '192.168.3.251:9002'} |
| | | # 禁止代理,不然会走本地代理 |
| | | response = requests.post(url, data=data, headers=headers, proxies={"http": None, "https": None}) |
| | | if response.status_code != 200: |
| | | raise Exception("请求出错") |
| | | return response.text |
| | | def __base_request(url, data, timeout=10): |
| | | DELEGATE = True |
| | | if not DELEGATE: |
| | | headers = { |
| | | "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", |
| | | "User-Agent": "Dalvik / 2.1.0(Linux;U;Android 6.0.1;MuMu Build/V417IR)" |
| | | } |
| | | # proxies={'https': '192.168.3.251:9002'} |
| | | # 禁止代理,不然会走本地代理 |
| | | response = requests.post(url, data=data, headers=headers, proxies={"http": None, "https": None}, |
| | | timeout=timeout) |
| | | if response.status_code != 200: |
| | | raise Exception("请求出错") |
| | | return response.text |
| | | else: |
| | | fdata = middle_api_protocol.load_kpl(url, data, timeout) |
| | | return middle_api_protocol.request(fdata) |
| | | |
| | | |
| | | def daBanList(pidType): |