涩图模块:支持多关键词搜索

This commit is contained in:
Yutousama 2022-04-20 20:23:00 +08:00
parent dfd60919ad
commit 15b0e14edd

View File

@ -73,10 +73,12 @@ public class GetSeTu extends Model {
String[] keys = key.split(" "); String[] keys = key.split(" ");
StringBuilder keyBuilder = new StringBuilder(); StringBuilder keyBuilder = new StringBuilder();
for (String _key : keys) { for (String _key : keys) {
keyBuilder.append(_key).append("&tag="); keyBuilder.append(URLEncoder.encode(_key,StandardCharsets.UTF_8)).append("&tag=");
} }
key = keyBuilder.toString(); key = keyBuilder.toString();
key = key.substring(0, key.length() - 5); key = key.substring(0, key.length() - 5);
}else{
key=URLEncoder.encode(key,StandardCharsets.UTF_8);
} }
if (r18) { if (r18) {
url = "https://api.lolicon.app/setu/v2?" + model + "=" + key + "&r18=1&size=regular"; url = "https://api.lolicon.app/setu/v2?" + model + "=" + key + "&r18=1&size=regular";