Minor improvements to Aerisdies folder naming

This commit is contained in:
cyian-1756 2017-11-23 10:50:06 -05:00
parent f6d58ee748
commit 36cd9c713f

View File

@ -39,26 +39,26 @@ public class AerisdiesRipper extends AbstractHTMLRipper {
@Override @Override
public String getGID(URL url) throws MalformedURLException { 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()); Matcher m = p.matcher(url.toExternalForm());
if (!m.matches()) { if (!m.matches()) {
throw new MalformedURLException("Expected URL format: http://www.aerisdies.com/html/lb/albumDIG, got: " + url); 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 // @Override
public String getAlbumTitle(URL url) throws MalformedURLException { // public String getAlbumTitle(URL url) throws MalformedURLException {
try { // try {
// Attempt to use album title as GID // // Attempt to use album title as GID
String title = getFirstPage().select("title").first().text(); // String title = getFirstPage().select("title").first().text();
return getHost() + "_" + title.trim(); // return getHost() + "_" + title.trim();
} catch (IOException e) { // } catch (IOException e) {
// Fall back to default album naming convention // // Fall back to default album naming convention
logger.info("Unable to find title at " + url); // logger.info("Unable to find title at " + url);
} // }
return super.getAlbumTitle(url); // return super.getAlbumTitle(url);
} // }
@Override @Override
public Document getFirstPage() throws IOException { public Document getFirstPage() throws IOException {