|
|
@@ -165,7 +165,7 @@ def get_sold_xhr_page(log):
|
|
|
"sortType": "auction_end",
|
|
|
"ascSort": "desc"
|
|
|
}
|
|
|
- response = requests.post(url, headers=headers, json=data)
|
|
|
+ response = requests.post(url, headers=headers, json=data, timeout=5)
|
|
|
total = response.json()['data']['total']
|
|
|
if total:
|
|
|
return total
|
|
|
@@ -191,7 +191,7 @@ def fetch_all_pages(log):
|
|
|
"sortType": "auction_end",
|
|
|
"ascSort": "desc"
|
|
|
}
|
|
|
- response = requests.post(f"{base_url}/search/searchAuctionItem", headers=headers, json=data)
|
|
|
+ response = requests.post(f"{base_url}/search/searchAuctionItem", headers=headers, json=data, timeout=5)
|
|
|
page_data = response.json()['data']['cardCabinet']
|
|
|
# all_data.extend(page_data)
|
|
|
yield page_data
|
|
|
@@ -216,7 +216,7 @@ def get_bid(log, aid, page, token):
|
|
|
}
|
|
|
log.debug(f'正在获取竞价相关第{page}页的数据..................')
|
|
|
headers["token"] = token[0]
|
|
|
- response = requests.get(url, headers=headers, params=params)
|
|
|
+ response = requests.get(url, headers=headers, params=params, timeout=5)
|
|
|
# print(f'get_bid: {response.json()}')
|
|
|
if response.status_code != 200:
|
|
|
log.error(f"请求失败,状态码: {response.status_code}")
|