e621: improve title search for pools
authorNiki Roo <niki@nikiroo.be>
Fri, 1 May 2020 11:28:54 +0000 (13:28 +0200)
committerNiki Roo <niki@nikiroo.be>
Fri, 1 May 2020 11:28:54 +0000 (13:28 +0200)
supported/E621.java

index 602cd36309250e03de7291c4f46784b7171ccc93..c0125fb3f107087f170f8d2d8e6c718cb5253e87 100644 (file)
@@ -292,6 +292,22 @@ class E621 extends BasicSupport {
                                        builder.append(" ").append(tab[i]);
                                }
                        }
+
+                       if (builder.length() == 0) {
+                               String url = "https://e621.net/" + getSource().getPath()
+                                               + "?page=1";
+                               Document page1 = DataUtil.load(Instance.getInstance().getCache()
+                                               .open(getSource(), this, false), "UTF-8",
+                                               url.toString());
+                               for (Element el : page1.getElementsByClass("search-tag")) {
+                                       if (el.attr("itemprop").equals("author")) {
+                                               if (builder.length() > 0) {
+                                                       builder.append(", ");
+                                               }
+                                               builder.append(el.text().trim());
+                                       }
+                               }
+                       }
                }
 
                return builder.toString();