1.0.87 - Motherless video ripper
This commit is contained in:
parent
72ce875a74
commit
eb23e4fa82
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
||||
<groupId>com.rarchives.ripme</groupId>
|
||||
<artifactId>ripme</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0.86</version>
|
||||
<version>1.0.87</version>
|
||||
<name>ripme</name>
|
||||
<url>http://rip.rarchives.com</url>
|
||||
<properties>
|
||||
|
@ -40,7 +40,7 @@ public abstract class VideoRipper extends AbstractRipper {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addURLToDownload(URL url, File saveAs) {
|
||||
public boolean addURLToDownload(URL url, File saveAs) {
|
||||
if (Utils.getConfigBoolean("urls_only.save", false)) {
|
||||
// Output URL to file
|
||||
String urlFile = this.workingDir + File.separator + "urls.txt";
|
||||
@ -53,16 +53,18 @@ public abstract class VideoRipper extends AbstractRipper {
|
||||
observer.update(this, msg);
|
||||
} catch (IOException e) {
|
||||
logger.error("Error while writing to " + urlFile, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
threadPool.addThread(new DownloadVideoThread(url, saveAs, this));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addURLToDownload(URL url, File saveAs, String referrer, Map<String,String> cookies) {
|
||||
addURLToDownload(url, saveAs);
|
||||
public boolean addURLToDownload(URL url, File saveAs, String referrer, Map<String,String> cookies) {
|
||||
return addURLToDownload(url, saveAs);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -29,6 +29,11 @@ public class MotherlessRipper extends AlbumRipper {
|
||||
|
||||
@Override
|
||||
public boolean canRip(URL url) {
|
||||
try {
|
||||
getGID(url);
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
return url.getHost().endsWith(DOMAIN);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,68 @@
|
||||
package com.rarchives.ripme.ripper.rippers.video;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.rarchives.ripme.ripper.VideoRipper;
|
||||
import com.rarchives.ripme.utils.Http;
|
||||
import com.rarchives.ripme.utils.Utils;
|
||||
|
||||
public class MotherlessVideoRipper extends VideoRipper {
|
||||
|
||||
private static final String HOST = "motherless";
|
||||
|
||||
public MotherlessVideoRipper(URL url) throws IOException {
|
||||
super(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHost() {
|
||||
return HOST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRip(URL url) {
|
||||
Pattern p = Pattern.compile("^https?://[wm.]*motherless\\.com/[A-Z0-9]+.*$");
|
||||
Matcher m = p.matcher(url.toExternalForm());
|
||||
return m.matches();
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL sanitizeURL(URL url) throws MalformedURLException {
|
||||
return url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGID(URL url) throws MalformedURLException {
|
||||
Pattern p = Pattern.compile("^https?://[wm.]*motherless\\.com/([A-Z0-9]+).*$");
|
||||
Matcher m = p.matcher(url.toExternalForm());
|
||||
if (m.matches()) {
|
||||
return m.group(1);
|
||||
}
|
||||
|
||||
throw new MalformedURLException(
|
||||
"Expected motherless format:"
|
||||
+ "motherless.com/####"
|
||||
+ " Got: " + url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rip() throws IOException {
|
||||
logger.info(" Retrieving " + this.url);
|
||||
String html = Http.url(this.url).get().toString();
|
||||
if (html.contains("__fileurl = '")) {
|
||||
System.err.println("WTF");
|
||||
}
|
||||
List<String> vidUrls = Utils.between(html, "__fileurl = '", "';");
|
||||
if (vidUrls.size() == 0) {
|
||||
throw new IOException("Could not find video URL at " + url);
|
||||
}
|
||||
String vidUrl = vidUrls.get(0);
|
||||
addURLToDownload(new URL(vidUrl), HOST + "_" + getGID(this.url));
|
||||
waitForThreads();
|
||||
}
|
||||
}
|
@ -21,7 +21,7 @@ import com.rarchives.ripme.utils.Utils;
|
||||
public class UpdateUtils {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(UpdateUtils.class);
|
||||
private static final String DEFAULT_VERSION = "1.0.86";
|
||||
private static final String DEFAULT_VERSION = "1.0.87";
|
||||
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";
|
||||
|
Loading…
Reference in New Issue
Block a user