From 63729a7d827721a6f913f7ce40ebd630d6f12ec5 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Fri, 1 May 2020 14:07:14 +0200 Subject: [PATCH] e621: author improvement --- src/be/nikiroo/fanfix/supported/E621.java | 26 ++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/be/nikiroo/fanfix/supported/E621.java b/src/be/nikiroo/fanfix/supported/E621.java index c0125fb3..a8ea6e6c 100644 --- a/src/be/nikiroo/fanfix/supported/E621.java +++ b/src/be/nikiroo/fanfix/supported/E621.java @@ -294,18 +294,24 @@ class E621 extends BasicSupport { } 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(", "); + try { + String poolNumber = getSource().getPath() + .substring("/pools/".length()); + String url = "https://e621.net/posts" + "?tags=pool%3A" + + poolNumber; + + Document page1 = DataUtil.load(Instance.getInstance() + .getCache().open(getSource(), null, false), "UTF-8", + url); + for (Element el : page1.getElementsByClass("search-tag")) { + if (el.attr("itemprop").equals("author")) { + if (builder.length() > 0) { + builder.append(", "); + } + builder.append(el.text().trim()); } - builder.append(el.text().trim()); } + } catch (Exception e) { } } } -- 2.27.0