diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/EightmusesRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/EightmusesRipper.java index d97f5947..7c4d15c1 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/EightmusesRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/EightmusesRipper.java @@ -150,28 +150,14 @@ public class EightmusesRipper extends AbstractHTMLRipper { return imageURLs; } - private String getFullSizeImage(String imageUrl) throws IOException { - sendUpdate(STATUS.LOADING_RESOURCE, imageUrl); - LOGGER.info("Getting full sized image from " + imageUrl); - Document doc = new Http(imageUrl).get(); // Retrieve the webpage of the image URL - String imageName = doc.select("div.photo > a > img").attr("src"); - return "https://www.8muses.com/image/fl/" + imageName; - } - - private String getTitle(String albumTitle) { - albumTitle = albumTitle.replace("A huge collection of free porn comics for adults. Read ", ""); - albumTitle = albumTitle.replace(" online for free at 8muses.com", ""); - albumTitle = albumTitle.replace(" ", "_"); - return albumTitle; - } - - private String getSubdir(String rawHref) { + public String getSubdir(String rawHref) { LOGGER.info("Raw title: " + rawHref); String title = rawHref; title = title.replaceAll("8muses - Sex and Porn Comics", ""); - title = title.replaceAll("\t\t", ""); + title = title.replaceAll("\\s+", " "); title = title.replaceAll("\n", ""); title = title.replaceAll("\\| ", ""); + title = title.replace(" - ", "-"); title = title.replace(" ", "-"); LOGGER.info(title); return title; diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/EightmusesRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/EightmusesRipperTest.java index e29c9ece..a36e2c5b 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/EightmusesRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/EightmusesRipperTest.java @@ -21,5 +21,11 @@ public class EightmusesRipperTest extends RippersTest { public void testGID() throws IOException { EightmusesRipper ripper = new EightmusesRipper(new URL("https://www.8muses.com/comix/album/Affect3D-Comics/TheDude3DX/Lust-Unleashed-The-Urge-To-Explore")); assertEquals("Affect3D-Comics", ripper.getGID(new URL("https://www.8muses.com/comics/album/Affect3D-Comics/TheDude3DX/Lust-Unleashed-The-Urge-To-Explore"))); + assertEquals("Affect3D-Comics", ripper.getSubdir("After Party - Issue 1")); + } + + public void testGetSubdir() throws IOException { + EightmusesRipper ripper = new EightmusesRipper(new URL("https://www.8muses.com/comix/album/Affect3D-Comics/TheDude3DX/Lust-Unleashed-The-Urge-To-Explore")); + assertEquals("After-Party-Issue-1", ripper.getSubdir("After Party - Issue 1")); } } \ No newline at end of file