Merge pull request #277 from cyian-1756/AerisDies

Minor improvements to Aerisdies folder naming
This commit is contained in:
cyian-1756 2017-11-27 17:26:13 -05:00 committed by GitHub
commit 872c100ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,20 +39,20 @@ 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("div > div > span[id=albumname] > a").first().text();
return getHost() + "_" + title.trim(); return getHost() + "_" + getGID(url) + "_" + 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);