From 36cd9c713f5210ebc3c87c945de404f1ace643cf Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Thu, 23 Nov 2017 10:50:06 -0500 Subject: [PATCH 1/2] Minor improvements to Aerisdies folder naming --- .../ripme/ripper/rippers/AerisdiesRipper.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/AerisdiesRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/AerisdiesRipper.java index 34661547..0e28c298 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/AerisdiesRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/AerisdiesRipper.java @@ -39,26 +39,26 @@ public class AerisdiesRipper extends AbstractHTMLRipper { @Override public String getGID(URL url) throws MalformedURLException { - Pattern p = Pattern.compile("^https?://www.aerisdies.com/html/lb/([a-z]*_[0-9]*_\\d)\\.html"); + Pattern p = Pattern.compile("^https?://www.aerisdies.com/html/lb/[a-z]*_(\\d+)_\\d\\.html"); Matcher m = p.matcher(url.toExternalForm()); if (!m.matches()) { throw new MalformedURLException("Expected URL format: http://www.aerisdies.com/html/lb/albumDIG, got: " + url); } - return m.group(m.groupCount()); + return m.group(1); } - @Override - public String getAlbumTitle(URL url) throws MalformedURLException { - try { - // Attempt to use album title as GID - String title = getFirstPage().select("title").first().text(); - return getHost() + "_" + 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 String getAlbumTitle(URL url) throws MalformedURLException { +// try { +// // Attempt to use album title as GID +// String title = getFirstPage().select("title").first().text(); +// return getHost() + "_" + 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 Document getFirstPage() throws IOException { From ef84cb143bb41fdff6b689ad2c764d47e44d8e3d Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Thu, 23 Nov 2017 10:56:43 -0500 Subject: [PATCH 2/2] Minor improvements to Aerisdies folder naming --- .../ripme/ripper/rippers/AerisdiesRipper.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/AerisdiesRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/AerisdiesRipper.java index 0e28c298..8e43aab0 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/AerisdiesRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/AerisdiesRipper.java @@ -47,18 +47,18 @@ public class AerisdiesRipper extends AbstractHTMLRipper { return m.group(1); } -// @Override -// public String getAlbumTitle(URL url) throws MalformedURLException { -// try { -// // Attempt to use album title as GID -// String title = getFirstPage().select("title").first().text(); -// return getHost() + "_" + 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 String getAlbumTitle(URL url) throws MalformedURLException { + try { + // Attempt to use album title as GID + String title = getFirstPage().select("div > div > span[id=albumname] > a").first().text(); + 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 Document getFirstPage() throws IOException {