Fixed EightmusesRipper so titles on disk no longer include ---
This commit is contained in:
parent
6a92c251c1
commit
d53a86fe8c
@ -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;
|
||||
|
@ -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"));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user