Various style cleanup.
This commit is contained in:
parent
9410ea806c
commit
d8d7b5096a
@ -98,7 +98,6 @@ public class App {
|
||||
}
|
||||
if (cl.hasOption('R')) {
|
||||
loadHistory();
|
||||
|
||||
if (HISTORY.toList().size() == 0) {
|
||||
System.err.println("There are no history entries to re-rip. Rip some albums first");
|
||||
System.exit(-1);
|
||||
@ -124,7 +123,7 @@ public class App {
|
||||
}
|
||||
if (added == 0) {
|
||||
System.err.println("No history entries have been 'Checked'\n" +
|
||||
"Check an entry by clicking the checkbox to the right of the URL or Right-click a URL to check/uncheck all items");
|
||||
"Check an entry by clicking the checkbox to the right of the URL or Right-click a URL to check/uncheck all items");
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
@ -138,33 +137,25 @@ public class App {
|
||||
System.err.println("\nCannot specify '-d' and '-D' simultaneously");
|
||||
System.exit(-1);
|
||||
}
|
||||
if(cl.hasOption('l')) {
|
||||
if (cl.hasOption('l')) {
|
||||
// change the default rips directory
|
||||
Utils.setConfigString("rips.directory", cl.getOptionValue('l'));
|
||||
}
|
||||
|
||||
if (cl.hasOption('f')) {
|
||||
|
||||
String filename = cl.getOptionValue('f');
|
||||
|
||||
String filename = cl.getOptionValue('f');
|
||||
try {
|
||||
|
||||
String url;
|
||||
|
||||
BufferedReader br = new BufferedReader(new FileReader(filename));
|
||||
BufferedReader br = new BufferedReader(new FileReader(filename));
|
||||
while((url = br.readLine()) != null) {
|
||||
// loop through each url in the file and proces each url individually.
|
||||
ripURL(url.trim(), cl.hasOption("n"));
|
||||
}
|
||||
|
||||
} catch (FileNotFoundException fne) {
|
||||
logger.error("[!] File containing list of URLs not found. Cannot continue.");
|
||||
} catch (IOException ioe) {
|
||||
logger.error("[!] Failed reading file containing list of URLs. Cannot continue.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (cl.hasOption('u')) {
|
||||
String url = cl.getOptionValue('u').trim();
|
||||
ripURL(url, cl.hasOption("n"));
|
||||
@ -195,15 +186,15 @@ public class App {
|
||||
|
||||
public static Options getOptions() {
|
||||
Options opts = new Options();
|
||||
opts.addOption("h", "help", false, "Print the help");
|
||||
opts.addOption("u", "url", true, "URL of album to rip");
|
||||
opts.addOption("t", "threads", true, "Number of download threads per rip");
|
||||
opts.addOption("h", "help", false, "Print the help");
|
||||
opts.addOption("u", "url", true, "URL of album to rip");
|
||||
opts.addOption("t", "threads", true, "Number of download threads per rip");
|
||||
opts.addOption("w", "overwrite", false, "Overwrite existing files");
|
||||
opts.addOption("r", "rerip", false, "Re-rip all ripped albums");
|
||||
opts.addOption("R", "rerip-selected", false, "Re-rip all selected albums");
|
||||
opts.addOption("d", "saveorder", false, "Save the order of images in album");
|
||||
opts.addOption("r", "rerip", false, "Re-rip all ripped albums");
|
||||
opts.addOption("R", "rerip-selected", false, "Re-rip all selected albums");
|
||||
opts.addOption("d", "saveorder", false, "Save the order of images in album");
|
||||
opts.addOption("D", "nosaveorder", false, "Don't save order of images");
|
||||
opts.addOption("4", "skip404", false, "Don't retry after a 404 (not found) error");
|
||||
opts.addOption("4", "skip404", false, "Don't retry after a 404 (not found) error");
|
||||
opts.addOption("l", "ripsdirectory", true, "Rips Directory (Default: ./rips)");
|
||||
opts.addOption("n", "no-prop-file", false, "Do not create properties file.");
|
||||
opts.addOption("f", "urls-file", true, "Rip URLs from a file.");
|
||||
|
@ -150,7 +150,6 @@ public abstract class AbstractRipper
|
||||
return addURLToDownload(url, saveFileAs, referrer, cookies);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Queues file to be downloaded and saved. With options.
|
||||
* @param url
|
||||
|
@ -17,7 +17,6 @@ import com.rarchives.ripme.ripper.rippers.ripperhelpers.ChanSite;
|
||||
import com.rarchives.ripme.utils.Http;
|
||||
import com.rarchives.ripme.utils.RipUtils;
|
||||
|
||||
|
||||
public class ChanRipper extends AbstractHTMLRipper {
|
||||
public static List<ChanSite> explicit_domains = Arrays.asList(
|
||||
new ChanSite(Arrays.asList("boards.4chan.org"), Arrays.asList("4cdn.org", "is.4chan.org", "is2.4chan.org")),
|
||||
@ -195,7 +194,6 @@ public class ChanRipper extends AbstractHTMLRipper {
|
||||
}
|
||||
|
||||
List<URL> urls = RipUtils.getFilesFromURL(originalURL);
|
||||
//for (int i = 0; i < urls.size(); i++) {
|
||||
for(URL imageurl : urls){
|
||||
imageURLs.add(imageurl.toString());
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class History {
|
||||
|
||||
private final List<HistoryEntry> list;
|
||||
private static final String[] COLUMNS = new String[] {
|
||||
"URL",
|
||||
@ -132,7 +131,7 @@ public class History {
|
||||
return list;
|
||||
}
|
||||
|
||||
public boolean isEmpty(){
|
||||
public boolean isEmpty() {
|
||||
return list.isEmpty();
|
||||
}
|
||||
|
||||
@ -144,5 +143,4 @@ public class History {
|
||||
os.close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
|
||||
import com.rarchives.ripme.utils.Utils;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class UpdateUtils {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user