From ef1bf79dddfe009f00f80669cefe680e626eb26d Mon Sep 17 00:00:00 2001 From: EgorGornak Date: Mon, 27 Nov 2017 17:37:04 +0300 Subject: [PATCH] Change folder name in imagearn --- .../ripme/ripper/rippers/ImagearnRipper.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/ImagearnRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/ImagearnRipper.java index 475817c9..1bae88c2 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/ImagearnRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/ImagearnRipper.java @@ -29,6 +29,20 @@ public class ImagearnRipper extends AbstractHTMLRipper { return "imagearn.com"; } + @Override + public String getAlbumTitle(URL url) throws MalformedURLException { + try { + Document doc = getFirstPage(); + String title = doc.select("h3 > strong").first().text(); // profile name + logger.error(title); + return getHost() + "_" + title; + } catch (Exception e) { + // Fall back to default album naming convention + logger.warn("Failed to get album title from " + url, e); + } + return super.getAlbumTitle(url); + } + @Override public String getGID(URL url) throws MalformedURLException { Pattern p = Pattern.compile("^.*imagearn.com/+gallery.php\\?id=([0-9]+).*$");