rgfewfger

This commit is contained in:
27942
2025-12-11 16:56:14 +08:00
parent 3245574087
commit 577e0f62e4

View File

@@ -122,23 +122,6 @@ class WeexTransaction:
def get_price(self):
headers = {
'accept': 'application/json, text/plain, */*',
'accept-language': 'zh-CN,zh;q=0.9',
'cache-control': 'no-cache',
'origin': 'https://derivatives.bitmart.com',
'pragma': 'no-cache',
'priority': 'u=1, i',
'referer': 'https://derivatives.bitmart.com/',
'sec-ch-ua': '"Not;A=Brand";v="99", "Google Chrome";v="139", "Chromium";v="139"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
}
params = {
'unit': '30',
'resolution': 'M',
@@ -151,8 +134,7 @@ class WeexTransaction:
for i in range(3):
logger.info(f"获取最新数据:{i + 1}次。。。")
try:
response = self.session.get('https://contract-v2.bitmart.com/v1/ifcontract/quote/kline', params=params,
headers=headers, timeout=5)
response = self.session.get('https://contract-v2.bitmart.com/v1/ifcontract/quote/kline', params=params, timeout=5)
for i in response.json()["data"]:
insert_data = {