Open sunlin92 opened 2 years ago
调用waifulabs接口,返回ai随机生成的美少女头像
waifus = [] async def get_waifu(): global waifus if not waifus: import json import requests URL = "https://api.waifulabs.com/generate" payload = {"step": 0} headers = {"Content-Type": "application/json"} response_str = requests.post( URL, data=json.dumps(payload), headers=headers ).text waifus.extend( [ "base64://" + waifu_data["image"] for waifu_data in json.loads(response_str)["newGirls"] ] ) current_waifu = waifus.pop() return Message(f"[CQ:image,file={current_waifu}]")
这个接口是不是寄了 response_str是Not Found
看了眼推,上周上线了新版网站,这个接口应该是寄了
调用waifulabs接口,返回ai随机生成的美少女头像