fix qrcode use httpx.

This commit is contained in:
91c0e59d-6161-45ab-8aa4-2371574db28f 2025-01-25 10:45:52 +08:00
parent a4fe8208d9
commit 1dbd4426c3

View File

@ -29,7 +29,6 @@ class aes_pkcs7(object):
def decrypt(self, content):
cipher = AES.new(self.key, AES.MODE_CBC, self.iv)
#content = base64.b64decode(content)
return cipher.decrypt(content)
text = cipher.decrypt(content).decode('utf-8')
return self.pkcs7unpadding(text)
@ -96,7 +95,10 @@ def qr_api(qr_code):
"Host": "ai.sys-all.cn",
"User-Agent": "WC_AIME_LIB"
}
res = requests.post("http://ai.sys-allnet.cn/wc_aime/api/get_data", data=json.dumps(param, separators=(',', ':')), headers=headers)
# print(param) # debug打印param数据
res = httpx.post(
"http://ai.sys-allnet.cn/wc_aime/api/get_data",
data = json.dumps(param, separators=(',', ':')),
headers = headers
)
assert res.status_code == 200, "网络错误"
return json.loads(res.content)