新增涩图

This commit is contained in:
2022-01-02 00:14:27 +08:00
parent eedd304c43
commit 5b928afa82
2 changed files with 28 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
package com.yutou.qqbot.models.setu;
import com.alibaba.fastjson.JSONObject;
import com.yutou.qqbot.QQBotManager;
import com.yutou.qqbot.interfaces.DownloadInterface;
import com.yutou.qqbot.models.Model;
@@ -24,7 +25,10 @@ public class GetSeTu extends Model {
public void onMessage(Long qq, MessageEvent event, boolean isGroup) {
super.onMessage(qq, event, isGroup);
if ("来点色图".equals(msg)||"来点涩图".equals(msg)){
HttpTools.download(" https://api.ixiaowai.cn/api/api.php",
String ret=HttpTools.get("https://api.ixiaowai.cn/api/api.php?return=json");
System.out.println("ret = " + ret);
JSONObject json=JSONObject.parseObject(ret);
HttpTools.download(json.getString("acgurl"),
null, new DownloadInterface() {
@Override
public void onDownload(File file) {
@@ -35,4 +39,19 @@ public class GetSeTu extends Model {
});
}
}
public static void main(String[] args) {
HttpTools.download("https://api.ixiaowai.cn/api/api.php", null, new DownloadInterface() {
@Override
public void onDownload(File file) {
super.onDownload(file);
System.out.println(file.getAbsoluteFile());
}
@Override
public void onError(Exception e) {
e.printStackTrace();
}
});
}
}