add timeout

This commit is contained in:
armv7a 2025-04-01 12:35:09 +08:00
parent 5f81c60716
commit 5ecb34920a

View File

@ -56,6 +56,9 @@ def sdgb_api(data, useApi, userId):
data_enc = aes.encrypt(data)
data_def = zlib.compress(data_enc)
endpoint = "https://maimai-gm.wahlap.com:42081/Maimai2Servlet/"
timeout = httpx.Timeout(40.0, read=40.0)
r = httpx.post(
endpoint + get_hash_api(useApi),
headers = {
@ -67,7 +70,8 @@ def sdgb_api(data, useApi, userId):
"Content-Encoding": "deflate",
"Expect": "100-continue"
},
data = data_def
data = data_def,
timeout=timeout
)
resp_def = r.content