1.0.33 - Allow duplicate URLs on the imgur ripper

This commit is contained in:
4pr0n 2014-04-30 20:13:44 -07:00
parent 761e75c07d
commit 535efb4d88
4 changed files with 20 additions and 5 deletions

View File

@ -4,7 +4,7 @@
<groupId>com.rarchives.ripme</groupId>
<artifactId>ripme</artifactId>
<packaging>jar</packaging>
<version>1.0.32</version>
<version>1.0.33</version>
<name>ripme</name>
<url>http://rip.rarchives.com</url>
<properties>

View File

@ -28,10 +28,15 @@ public abstract class AlbumRipper extends AbstractRipper {
public abstract String getHost();
public abstract String getGID(URL url) throws MalformedURLException;
public boolean allowDuplicates() {
return false;
}
public void addURLToDownload(URL url, File saveAs, String referrer, Map<String,String> cookies) {
if (itemsPending.containsKey(url)
|| itemsCompleted.containsKey(url)
|| itemsErrored.containsKey(url)) {
if (!allowDuplicates()
&& ( itemsPending.containsKey(url)
|| itemsCompleted.containsKey(url)
|| itemsErrored.containsKey(url) )) {
// Item is already downloaded/downloading, skip it.
logger.info("[!] Skipping " + url + " -- already attempted: " + Utils.removeCWD(saveAs));
return;

View File

@ -45,6 +45,15 @@ public class ImgurRipper extends AlbumRipper {
SLEEP_BETWEEN_ALBUMS = 1;
}
/**
* Imgur ripper does not return the same URL except when ripping
* many albums at once (USER). In this case, we want duplicates.
*/
@Override
public boolean allowDuplicates() {
return true;
}
public boolean canRip(URL url) {
if (!url.getHost().endsWith(DOMAIN)) {
return false;
@ -129,6 +138,7 @@ public class ImgurRipper extends AlbumRipper {
logger.info(" Retrieving " + url.toExternalForm());
Document doc = Jsoup.connect(url.toExternalForm())
.userAgent(USER_AGENT)
.timeout(10 * 1000)
.maxBodySize(0)
.get();

View File

@ -19,7 +19,7 @@ import org.jsoup.nodes.Document;
public class UpdateUtils {
private static final Logger logger = Logger.getLogger(UpdateUtils.class);
private static final String DEFAULT_VERSION = "1.0.32";
private static final String DEFAULT_VERSION = "1.0.33";
private static final String updateJsonURL = "http://rarchives.com/ripme.json";
private static final String updateJarURL = "http://rarchives.com/ripme.jar";
private static final String mainFileName = "ripme.jar";