commit
6ed509aa06
@ -68,7 +68,13 @@ public abstract class AbstractHTMLRipper extends AlbumRipper {
|
|||||||
Document doc = getFirstPage();
|
Document doc = getFirstPage();
|
||||||
|
|
||||||
while (doc != null) {
|
while (doc != null) {
|
||||||
|
if (alreadyDownloadedUrls >= Utils.getConfigInteger("history.end_rip_after_already_seen", -1) && !isThisATest()) {
|
||||||
|
sendUpdate(STATUS.DOWNLOAD_COMPLETE, "Already seen the last " + alreadyDownloadedUrls + " images ending rip");
|
||||||
|
break;
|
||||||
|
}
|
||||||
List<String> imageURLs = getURLsFromPage(doc);
|
List<String> imageURLs = getURLsFromPage(doc);
|
||||||
|
// If hasASAPRipping() returns true then the ripper will handle downloading the files
|
||||||
|
// if not it's done in the following block of code
|
||||||
if (!hasASAPRipping()) {
|
if (!hasASAPRipping()) {
|
||||||
// Remove all but 1 image
|
// Remove all but 1 image
|
||||||
if (isThisATest()) {
|
if (isThisATest()) {
|
||||||
|
@ -44,7 +44,8 @@ public abstract class AbstractRipper
|
|||||||
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; }
|
public boolean hasASAPRipping() { return false; }
|
||||||
|
// Everytime addUrlToDownload skips a already downloaded url this increases by 1
|
||||||
|
public int alreadyDownloadedUrls = 0;
|
||||||
private boolean shouldStop = false;
|
private boolean shouldStop = false;
|
||||||
private boolean thisIsATest = false;
|
private boolean thisIsATest = false;
|
||||||
|
|
||||||
@ -194,9 +195,11 @@ public abstract class AbstractRipper
|
|||||||
* False if failed to download
|
* False if failed to download
|
||||||
*/
|
*/
|
||||||
protected boolean addURLToDownload(URL url, String prefix, String subdirectory, String referrer, Map<String, String> cookies) {
|
protected boolean addURLToDownload(URL url, String prefix, String subdirectory, String referrer, Map<String, String> cookies) {
|
||||||
|
// Don't re-add the url if it was downloaded in a previous rip
|
||||||
if (Utils.getConfigBoolean("remember.url_history", true) && !isThisATest()) {
|
if (Utils.getConfigBoolean("remember.url_history", true) && !isThisATest()) {
|
||||||
if (hasDownloadedURL(url.toExternalForm())) {
|
if (hasDownloadedURL(url.toExternalForm())) {
|
||||||
sendUpdate(STATUS.DOWNLOAD_WARN, "Already downloaded " + url.toExternalForm());
|
sendUpdate(STATUS.DOWNLOAD_WARN, "Already downloaded " + url.toExternalForm());
|
||||||
|
alreadyDownloadedUrls += 1;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user