From 1b5b58ebb4d7575feeafadc98c1b7d03d6759c5f Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Fri, 8 Jun 2018 16:52:33 -0400 Subject: [PATCH] Removed shared account due to privacy concerns --- .../ripme/ripper/rippers/FuraffinityRipper.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/FuraffinityRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/FuraffinityRipper.java index 440e9ae5..ed42ffcc 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/FuraffinityRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/FuraffinityRipper.java @@ -29,8 +29,11 @@ public class FuraffinityRipper extends AbstractHTMLRipper { private static final String urlBase = "https://www.furaffinity.net"; private static Map cookies = new HashMap<>(); static { - cookies.put("b", "bd5ccac8-51dc-4265-8ae1-7eac685ad667"); - cookies.put("a", "7c41b782-d01d-4b0e-b45b-62a4f0b2a369"); + if (Utils.getConfigString("furaffinity.cookie.a", "") != "" && Utils.getConfigString("furaffinity.cookie.b", "") != "") { + LOGGER.info("Logging in using cookies"); + cookies.put("b", Utils.getConfigString("furaffinity.cookie.b", "")); + cookies.put("a", Utils.getConfigString("furaffinity.cookie.a", "")); + } } // Thread pool for finding direct image links from "image" pages (html) @@ -91,9 +94,12 @@ public class FuraffinityRipper extends AbstractHTMLRipper { @Override public List getURLsFromPage(Document page) { List urls = new ArrayList<>(); - Elements urlElements = page.select("figure.t-image > b > u > a"); + Elements urlElements = page.select("figure > b > u > a"); for (Element e : urlElements) { - urls.add(getImageFromPost(urlBase + e.select("a").first().attr("href"))); + String urlToAdd = getImageFromPost(urlBase + e.select("a").first().attr("href")); + if (urlToAdd.startsWith("http")) { + urls.add(urlToAdd); + } } return urls; }