forked from Fragrance/maquitous
add timeout
This commit is contained in:
parent
5f81c60716
commit
5ecb34920a
6
sdgb.py
6
sdgb.py
@ -56,6 +56,9 @@ def sdgb_api(data, useApi, userId):
|
|||||||
data_enc = aes.encrypt(data)
|
data_enc = aes.encrypt(data)
|
||||||
data_def = zlib.compress(data_enc)
|
data_def = zlib.compress(data_enc)
|
||||||
endpoint = "https://maimai-gm.wahlap.com:42081/Maimai2Servlet/"
|
endpoint = "https://maimai-gm.wahlap.com:42081/Maimai2Servlet/"
|
||||||
|
|
||||||
|
timeout = httpx.Timeout(40.0, read=40.0)
|
||||||
|
|
||||||
r = httpx.post(
|
r = httpx.post(
|
||||||
endpoint + get_hash_api(useApi),
|
endpoint + get_hash_api(useApi),
|
||||||
headers = {
|
headers = {
|
||||||
@ -67,7 +70,8 @@ def sdgb_api(data, useApi, userId):
|
|||||||
"Content-Encoding": "deflate",
|
"Content-Encoding": "deflate",
|
||||||
"Expect": "100-continue"
|
"Expect": "100-continue"
|
||||||
},
|
},
|
||||||
data = data_def
|
data = data_def,
|
||||||
|
timeout=timeout
|
||||||
)
|
)
|
||||||
resp_def = r.content
|
resp_def = r.content
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user