From a5ddf86d0805000c4452b42f46d0712ad716b5a2 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Mon, 31 Dec 2018 07:45:52 -0500 Subject: [PATCH 1/3] Added an else block so the pdf download unit test wouldn't fail --- .../rarchives/ripme/ripper/rippers/HentaifoundryRipper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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..bd35f935 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/HentaifoundryRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/HentaifoundryRipper.java @@ -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)); } } From bdd5d7254e14d205e145cfafec536f8fbb55dec4 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Mon, 31 Dec 2018 07:51:19 -0500 Subject: [PATCH 2/3] Fixed hentaifoundry ripper getGID --- .../com/rarchives/ripme/ripper/rippers/HentaifoundryRipper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 bd35f935..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: " From 051175fdc7bfc5c7df8daf07cb137e994cbd7465 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Mon, 31 Dec 2018 07:51:44 -0500 Subject: [PATCH 3/3] Added unit test for getGID --- .../ripme/tst/ripper/rippers/HentaifoundryRipperTest.java | 6 ++++++ 1 file changed, 6 insertions(+) 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);