Added getAlbumTitle to batoRipper

This commit is contained in:
cyian-1756 2018-05-17 19:56:41 -04:00
parent 8a27941dde
commit 05b50a4513

View File

@ -42,6 +42,18 @@ public class BatoRipper extends AbstractHTMLRipper {
"bato.to/chapter/ID - got " + url + " instead"); "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 @Override
public boolean canRip(URL url) { public boolean canRip(URL url) {
Pattern p = Pattern.compile("https?://bato.to/series/([\\d]+)/?"); Pattern p = Pattern.compile("https?://bato.to/series/([\\d]+)/?");