'Save URLs only' works for videos
This commit is contained in:
parent
97506c8741
commit
315c703e3c
@ -1,6 +1,7 @@
|
|||||||
package com.rarchives.ripme.ripper;
|
package com.rarchives.ripme.ripper;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@ -40,8 +41,24 @@ public abstract class VideoRipper extends AbstractRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addURLToDownload(URL url, File saveAs) {
|
public void addURLToDownload(URL url, File saveAs) {
|
||||||
|
if (Utils.getConfigBoolean("urls_only.save", false)) {
|
||||||
|
// Output URL to file
|
||||||
|
String urlFile = this.workingDir + File.separator + "urls.txt";
|
||||||
|
try {
|
||||||
|
FileWriter fw = new FileWriter(urlFile, true);
|
||||||
|
fw.write(url.toExternalForm());
|
||||||
|
fw.write("\n");
|
||||||
|
fw.close();
|
||||||
|
RipStatusMessage msg = new RipStatusMessage(STATUS.DOWNLOAD_COMPLETE, urlFile);
|
||||||
|
observer.update(this, msg);
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.error("Error while writing to " + urlFile, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
threadPool.addThread(new DownloadVideoThread(url, saveAs, this));
|
threadPool.addThread(new DownloadVideoThread(url, saveAs, this));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addURLToDownload(URL url, File saveAs, String referrer, Map<String,String> cookies) {
|
public void addURLToDownload(URL url, File saveAs, String referrer, Map<String,String> cookies) {
|
||||||
|
Loading…
Reference in New Issue
Block a user