Merge pull request #313 from cyian-1756/api-changes

Added hasASAPRipping(), which if returns true allows a ripper to not return anything from getURLsFromPage()
This commit is contained in:
cyian-1756 2018-02-07 11:07:09 -05:00 committed by GitHub
commit 80e746adbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 14 deletions

View File

@ -69,6 +69,7 @@ public abstract class AbstractHTMLRipper extends AlbumRipper {
while (doc != null) { while (doc != null) {
List<String> imageURLs = getURLsFromPage(doc); List<String> imageURLs = getURLsFromPage(doc);
if (!hasASAPRipping()) {
// Remove all but 1 image // Remove all but 1 image
if (isThisATest()) { if (isThisATest()) {
while (imageURLs.size() > 1) { while (imageURLs.size() > 1) {
@ -88,6 +89,7 @@ public abstract class AbstractHTMLRipper extends AlbumRipper {
break; break;
} }
} }
}
if (hasDescriptionSupport() && Utils.getConfigBoolean("descriptions.save", false)) { if (hasDescriptionSupport() && Utils.getConfigBoolean("descriptions.save", false)) {
logger.debug("Fetching description(s) from " + doc.location()); logger.debug("Fetching description(s) from " + doc.location());
List<String> textURLs = getDescriptionsFromPage(doc); List<String> textURLs = getDescriptionsFromPage(doc);

View File

@ -43,6 +43,7 @@ public abstract class AbstractRipper
public abstract void rip() throws IOException; public abstract void rip() throws IOException;
public abstract String getHost(); public abstract String getHost();
public abstract String getGID(URL url) throws MalformedURLException; public abstract String getGID(URL url) throws MalformedURLException;
public boolean hasASAPRipping() { return false; }
private boolean shouldStop = false; private boolean shouldStop = false;
private boolean thisIsATest = false; private boolean thisIsATest = false;