From 05b50a4513e83e7838f03a0198c72dee4abb4e30 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Thu, 17 May 2018 19:56:41 -0400 Subject: [PATCH] Added getAlbumTitle to batoRipper --- .../rarchives/ripme/ripper/rippers/BatoRipper.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/BatoRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/BatoRipper.java index a25aa16b..6578b7b1 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/BatoRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/BatoRipper.java @@ -42,6 +42,18 @@ public class BatoRipper extends AbstractHTMLRipper { "bato.to/chapter/ID - got " + url + " instead"); } + @Override + public String getAlbumTitle(URL url) throws MalformedURLException { + try { + // Attempt to use album title as GID + return getHost() + "_" + getGID(url) + "_" + getFirstPage().select("title").first().text().replaceAll(" ", "_"); + } catch (IOException e) { + // Fall back to default album naming convention + logger.info("Unable to find title at " + url); + } + return super.getAlbumTitle(url); + } + @Override public boolean canRip(URL url) { Pattern p = Pattern.compile("https?://bato.to/series/([\\d]+)/?");