This commit is contained in:
qwerdvd 2023-10-30 16:11:38 +08:00
parent 98f34b1cc8
commit ac39e4331e
No known key found for this signature in database
GPG Key ID: A3AF89C783404769

View File

@ -21,7 +21,8 @@ async def get_char_card_info(
) as client: ) as client:
req = await client.get(f"/sr_info/{uid}") req = await client.get(f"/sr_info/{uid}")
if save_path: if save_path:
save_path.mkdir(parents=True, exist_ok=True) path = save_path / str(uid)
with Path.open(save_path / uid / f"{uid!s}.json", "w") as file: path.mkdir(parents=True, exist_ok=True)
with Path.open(path / f"{uid!s}.json", "w") as file:
file.write(req.text) file.write(req.text)
return convert(req.json(), type=MihomoData) return convert(req.json(), type=MihomoData)