Fixed EightmusesRipper so titles on disk no longer include ---

This commit is contained in:
cyian-1756 2018-09-17 00:31:20 -04:00
parent 6a92c251c1
commit d53a86fe8c
2 changed files with 9 additions and 17 deletions

View File

@ -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;

View File

@ -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"));
}
}