commit
364fa7de52
@ -47,7 +47,7 @@ public abstract class AbstractRipper
|
|||||||
// Everytime addUrlToDownload skips a already downloaded url this increases by 1
|
// Everytime addUrlToDownload skips a already downloaded url this increases by 1
|
||||||
public int alreadyDownloadedUrls = 0;
|
public int alreadyDownloadedUrls = 0;
|
||||||
private boolean shouldStop = false;
|
private boolean shouldStop = false;
|
||||||
private boolean thisIsATest = false;
|
private static boolean thisIsATest = false;
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
shouldStop = true;
|
shouldStop = true;
|
||||||
@ -611,7 +611,7 @@ public abstract class AbstractRipper
|
|||||||
LOGGER.debug("THIS IS A TEST RIP");
|
LOGGER.debug("THIS IS A TEST RIP");
|
||||||
thisIsATest = true;
|
thisIsATest = true;
|
||||||
}
|
}
|
||||||
protected boolean isThisATest() {
|
protected static boolean isThisATest() {
|
||||||
return thisIsATest;
|
return thisIsATest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import org.jsoup.HttpStatusException;
|
|||||||
|
|
||||||
import com.rarchives.ripme.ui.RipStatusMessage.STATUS;
|
import com.rarchives.ripme.ui.RipStatusMessage.STATUS;
|
||||||
import com.rarchives.ripme.utils.Utils;
|
import com.rarchives.ripme.utils.Utils;
|
||||||
|
import com.rarchives.ripme.ripper.AbstractRipper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thread for downloading files.
|
* Thread for downloading files.
|
||||||
@ -222,6 +223,14 @@ class DownloadFileThread extends Thread {
|
|||||||
observer.setBytesCompleted(bytesDownloaded);
|
observer.setBytesCompleted(bytesDownloaded);
|
||||||
observer.sendUpdate(STATUS.COMPLETED_BYTES, bytesDownloaded);
|
observer.sendUpdate(STATUS.COMPLETED_BYTES, bytesDownloaded);
|
||||||
}
|
}
|
||||||
|
// If this is a test and we're downloading a large file
|
||||||
|
if (AbstractRipper.isThisATest() && bytesTotal / 10000000 >= 10) {
|
||||||
|
logger.debug("Not downloading whole file because it is over 10mb and this is a test");
|
||||||
|
bis.close();
|
||||||
|
fos.close();
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
bis.close();
|
bis.close();
|
||||||
fos.close();
|
fos.close();
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.rarchives.ripme.tst.ripper.rippers;
|
||||||
|
|
||||||
|
import com.rarchives.ripme.ripper.rippers.HqpornerRipper;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
public class HqpornerRipperTest extends RippersTest{
|
||||||
|
|
||||||
|
public void testRip() throws IOException {
|
||||||
|
HqpornerRipper ripper = new HqpornerRipper(new URL("https://hqporner.com/hdporn/84636-pool_lesson_with_a_cheating_husband.html"));
|
||||||
|
testRipper(ripper);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testGetGID() throws IOException {
|
||||||
|
URL poolURL = new URL("https://hqporner.com/hdporn/84636-pool_lesson_with_a_cheating_husband.html");
|
||||||
|
HqpornerRipper ripper = new HqpornerRipper(poolURL);
|
||||||
|
assertEquals("84636-pool_lesson_with_a_cheating_husband", ripper.getGID(poolURL));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user