eroshare ripper now grabs album name

This commit is contained in:
cyian-1756 2017-03-19 19:50:29 -04:00
parent 306b7ec9cb
commit 141478213c

View File

@ -49,6 +49,22 @@ public class EroShareRipper extends AbstractHTMLRipper {
addURLToDownload(url);
}
@Override
public String getAlbumTitle(URL url) throws MalformedURLException {
try {
// Attempt to use album title as GID
Element titleElement = getFirstPage().select("meta[property=og:title]").first();
String title = titleElement.attr("content");
title = title.substring(title.lastIndexOf('/') + 1);
return getHost() + "_" + getGID(url) + "_" + title.trim();
} catch (IOException e) {
// Fall back to default album naming convention
logger.info("Unable to find title at " + url);
}
return super.getAlbumTitle(url);
}
@Override
public List<String> getURLsFromPage(Document doc){
List<String> URLs = new ArrayList<String>();