Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/main/java/com/rarchives/ripme/ripper/AbstractHTMLRipper.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,27 @@ public void rip() throws IOException {
sendUpdate(STATUS.LOADING_RESOURCE, this.url.toExternalForm());
Document doc = getFirstPage();

boolean first = true;

while (doc != null) {
List<String> imageURLs = getURLsFromPage(doc);

// Remove all but 1 image
if (isThisATest()) {
while (imageURLs.size() > 1) {
imageURLs.remove(1);
}
}

//if (imageURLs.size() == 0) {
if (imageURLs.size() == 0) {
throw new IOException("No images found at " + doc.location());
if (first) {
throw new IOException("No images found at " + doc.location());
}
else {
logger.info("No images in page...");
break;
}
}

for (String imageURL : imageURLs) {
Expand Down Expand Up @@ -120,6 +130,8 @@ public void rip() throws IOException {
logger.info("Can't get next page: " + e.getMessage());
break;
}

first = false;
}

// If they're using a thread pool, wait for it.
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/rarchives/ripme/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ public static void setConfigList(String key, Enumeration<Object> enumeration) {
}
config.addProperty(key, list);
}

public static void clearConfigProperty(String key)
{
config.clearProperty(key);
}

public static void saveConfig() {
try {
Expand Down