diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java index a37a0017..3f781da9 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java @@ -104,10 +104,7 @@ public class ImagefapRipper extends AlbumRipper { } public boolean canRip(URL url) { - if (!url.getHost().endsWith(DOMAIN)) { - return false; - } - return true; + return url.getHost().endsWith(DOMAIN); } } \ No newline at end of file diff --git a/src/main/java/com/rarchives/ripme/utils/Utils.java b/src/main/java/com/rarchives/ripme/utils/Utils.java index 3c514846..9f4f2b1e 100644 --- a/src/main/java/com/rarchives/ripme/utils/Utils.java +++ b/src/main/java/com/rarchives/ripme/utils/Utils.java @@ -245,9 +245,13 @@ public class Utils { } public static String filesystemSafe(String text) { - return text.replaceAll("[^a-zA-Z0-9.-]", "_") + text = text.replaceAll("[^a-zA-Z0-9.-]", "_") .replaceAll("__", "_") .replaceAll("_+$", ""); + if (text.length() > 255) { + text = text.substring(0, 254); + } + return text; } public static String bytesToHumanReadable(int bytes) {