Merge pull request #951 from cyian-1756/8musesNameFix

Fixed EightmusesRipper so titles on disk no longer include ---
This commit is contained in:
cyian-1756 2018-09-17 16:41:23 -04:00 committed by GitHub
commit 6b8101533a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 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

@ -22,4 +22,9 @@ public class EightmusesRipperTest extends RippersTest {
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")));
}
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"));
}
}