From 5d4717d7a304b033aef1ff5e87260c69e0c52296 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Wed, 20 Apr 2022 20:18:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=A9=E5=9B=BE=E6=A8=A1=E5=9D=97=EF=BC=9A?= =?UTF-8?q?=E7=A9=BA=E6=A0=BC=E6=9B=BF=E6=8D=A2=E6=88=90|=E4=BB=A5?= =?UTF-8?q?=E4=BE=BF=E6=94=AF=E6=8C=81=E5=A4=9A=E5=85=B3=E9=94=AE=E8=AF=8D?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yutou/qqbot/models/setu/GetSeTu.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java b/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java index cf93aa8..5bb20b6 100644 --- a/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java +++ b/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java @@ -69,7 +69,15 @@ public class GetSeTu extends Model { url = "https://api.lolicon.app/setu/v2?r18=1&size=regular"; } if (!StringUtils.isEmpty(key)) { - key=key.replace(" ","|"); + if("tag".equals(model)) { + String[] keys = key.split(" "); + StringBuilder keyBuilder = new StringBuilder(); + for (String _key : keys) { + keyBuilder.append(_key).append("&tag="); + } + key = keyBuilder.toString(); + key=key.substring(0,key.length()-4); + } if (r18) { url = "https://api.lolicon.app/setu/v2?" + model + "=" + URLEncoder.encode(key, StandardCharsets.UTF_8) + "&r18=1&size=regular"; } else { @@ -79,6 +87,7 @@ public class GetSeTu extends Model { if (fuzzyR18) { url = url.replace("&r18=0", "&r18=2").replace("&r18=1", "&r18=2"); } + System.out.println("url = " + url); String ret = HttpTools.get(url); JSONObject json = JSONObject.parseObject(ret); if (json.getJSONArray("data").size() == 0) {