use httpx instead of requests

This commit is contained in:
91c0e59d-6161-45ab-8aa4-2371574db28f
2025-01-25 10:40:43 +08:00
parent 5e83dfc8c5
commit a4fe8208d9
4 changed files with 19 additions and 25 deletions

View File

@@ -3,7 +3,7 @@ import zlib
import pytz
import base64
import hashlib
import requests
import httpx
from datetime import datetime
from Crypto.Cipher import AES
@@ -56,9 +56,8 @@ def sdgb_api(data, useApi, userId):
data = data
data_enc = aes.encrypt(data)
data_def = zlib.compress(data_enc)
requests.packages.urllib3.disable_warnings()
endpoint = "https://maimai-gm.wahlap.com:42081/Maimai2Servlet/"
r = requests.post(
r = httpx.post(
endpoint + get_hash_api(useApi),
headers = {
"User-Agent": "%s#%d"%(get_hash_api(useApi), userId),