Fixed Hentai2Read folder naming

This commit is contained in:
cyian-1756 2018-04-17 04:11:13 -04:00
parent 5206f1d30e
commit f8ae2212c0

View File

@ -33,7 +33,7 @@ public class Hentai2readRipper extends AbstractHTMLRipper {
@Override @Override
public String getGID(URL url) throws MalformedURLException { public String getGID(URL url) throws MalformedURLException {
Pattern p = Pattern.compile("https://hentai2read\\.com/([a-zA-Z0-9_-]*)/?"); Pattern p = Pattern.compile("https?://hentai2read\\.com/([a-zA-Z0-9_-]*)/\\d/?");
Matcher m = p.matcher(url.toExternalForm()); Matcher m = p.matcher(url.toExternalForm());
if (m.matches()) { if (m.matches()) {
return m.group(1); return m.group(1);
@ -63,9 +63,7 @@ public class Hentai2readRipper extends AbstractHTMLRipper {
@Override @Override
public String getAlbumTitle(URL url) throws MalformedURLException { public String getAlbumTitle(URL url) throws MalformedURLException {
try { try {
Document doc = getFirstPage(); return getHost() + "_" + getGID(url);
String title = doc.select("span[itemprop=title]").text();
return getHost() + "_" + title;
} catch (Exception e) { } catch (Exception e) {
// Fall back to default album naming convention // Fall back to default album naming convention
logger.warn("Failed to get album title from " + url, e); logger.warn("Failed to get album title from " + url, e);