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:
commit
80e746adbb
@ -69,23 +69,25 @@ public abstract class AbstractHTMLRipper extends AlbumRipper {
|
||||
|
||||
while (doc != null) {
|
||||
List<String> imageURLs = getURLsFromPage(doc);
|
||||
// Remove all but 1 image
|
||||
if (isThisATest()) {
|
||||
while (imageURLs.size() > 1) {
|
||||
imageURLs.remove(1);
|
||||
if (!hasASAPRipping()) {
|
||||
// Remove all but 1 image
|
||||
if (isThisATest()) {
|
||||
while (imageURLs.size() > 1) {
|
||||
imageURLs.remove(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (imageURLs.size() == 0) {
|
||||
throw new IOException("No images found at " + doc.location());
|
||||
}
|
||||
if (imageURLs.size() == 0) {
|
||||
throw new IOException("No images found at " + doc.location());
|
||||
}
|
||||
|
||||
for (String imageURL : imageURLs) {
|
||||
index += 1;
|
||||
logger.debug("Found image url #" + index + ": " + imageURL);
|
||||
downloadURL(new URL(imageURL), index);
|
||||
if (isStopped()) {
|
||||
break;
|
||||
for (String imageURL : imageURLs) {
|
||||
index += 1;
|
||||
logger.debug("Found image url #" + index + ": " + imageURL);
|
||||
downloadURL(new URL(imageURL), index);
|
||||
if (isStopped()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasDescriptionSupport() && Utils.getConfigBoolean("descriptions.save", false)) {
|
||||
|
@ -43,6 +43,7 @@ public abstract class AbstractRipper
|
||||
public abstract void rip() throws IOException;
|
||||
public abstract String getHost();
|
||||
public abstract String getGID(URL url) throws MalformedURLException;
|
||||
public boolean hasASAPRipping() { return false; }
|
||||
|
||||
private boolean shouldStop = false;
|
||||
private boolean thisIsATest = false;
|
||||
|
Loading…
Reference in New Issue
Block a user