1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-01 03:20:20 +02:00

Merge pull request #518 from cyian-1756/hentai2read-naming-fix

Fixed Hentai2Read folder naming
This commit is contained in:
cyian-1756
2018-04-17 04:22:28 -04:00
committed by GitHub

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);