diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/HentaifoundryRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/HentaifoundryRipper.java index 48663b2f..e9c1a810 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/HentaifoundryRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/HentaifoundryRipper.java @@ -40,7 +40,7 @@ public class HentaifoundryRipper extends AbstractHTMLRipper { Pattern p = Pattern.compile("^.*hentai-foundry\\.com/(pictures|stories)/user/([a-zA-Z0-9\\-_]+).*$"); Matcher m = p.matcher(url.toExternalForm()); if (m.matches()) { - return m.group(1); + return m.group(2); } throw new MalformedURLException( "Expected hentai-foundry.com gallery format: " @@ -135,6 +135,7 @@ public class HentaifoundryRipper extends AbstractHTMLRipper { // this if is for ripping pdf stories if (url.toExternalForm().contains("/stories/")) { for (Element pdflink : doc.select("a.pdfLink")) { + LOGGER.info("grabbing " + "http://www.hentai-foundry.com" + pdflink.attr("href")); imageURLs.add("http://www.hentai-foundry.com" + pdflink.attr("href")); } return imageURLs; @@ -177,8 +178,9 @@ public class HentaifoundryRipper extends AbstractHTMLRipper { // When downloading pdfs you *NEED* to end the cookies with the request or you just get the consent page if (url.toExternalForm().endsWith(".pdf")) { addURLToDownload(url, getPrefix(index), "", this.url.toExternalForm(), cookies); + } else { + addURLToDownload(url, getPrefix(index)); } - addURLToDownload(url, getPrefix(index)); } } diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/HentaifoundryRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/HentaifoundryRipperTest.java index c28958e8..1ea63e01 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/HentaifoundryRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/HentaifoundryRipperTest.java @@ -11,6 +11,12 @@ public class HentaifoundryRipperTest extends RippersTest { testRipper(ripper); } + public void testHentaifoundryGetGID() throws IOException { + HentaifoundryRipper ripper = new HentaifoundryRipper(new URL("https://www.hentai-foundry.com/stories/user/Rakked")); + testRipper(ripper); + assertEquals("Rakked", ripper.getGID(new URL("https://www.hentai-foundry.com/stories/user/Rakked"))); + } + public void testHentaifoundryPdfRip() throws IOException { HentaifoundryRipper ripper = new HentaifoundryRipper(new URL("https://www.hentai-foundry.com/stories/user/Rakked")); testRipper(ripper);