Merge pull request #486 from cyian-1756/eroshare

eroshare ripper now grabs album name

Fixes #460
This commit is contained in:
metaprime 2017-03-23 01:17:38 -07:00 committed by GitHub
commit a3d8e87639

View File

@ -49,6 +49,22 @@ public class EroShareRipper extends AbstractHTMLRipper {
addURLToDownload(url); 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 @Override
public List<String> getURLsFromPage(Document doc){ public List<String> getURLsFromPage(Document doc){
List<String> URLs = new ArrayList<String>(); List<String> URLs = new ArrayList<String>();