Missing braces, various cleanup.

This commit is contained in:
MetaPrime 2017-05-09 16:07:20 -07:00
parent 92405fb9f8
commit cd8784ed85
5 changed files with 130 additions and 141 deletions

View File

@ -4,7 +4,6 @@ import java.io.IOException;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -14,10 +13,8 @@ import java.util.regex.Pattern;
import org.jsoup.Connection.Response; import org.jsoup.Connection.Response;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element; import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import com.rarchives.ripme.ripper.AbstractHTMLRipper; import com.rarchives.ripme.ripper.AbstractHTMLRipper;
import com.rarchives.ripme.ui.RipStatusMessage.STATUS;
import com.rarchives.ripme.utils.Http; import com.rarchives.ripme.utils.Http;
public class ZizkiRipper extends AbstractHTMLRipper { public class ZizkiRipper extends AbstractHTMLRipper {

View File

@ -9,16 +9,20 @@ public class ChanSite {
public List<String> cdnDomains; public List<String> cdnDomains;
public ChanSite(List<String> Domains, List<String> CdnDomains) { public ChanSite(List<String> Domains, List<String> CdnDomains) {
if(Domains.isEmpty()) if (Domains.isEmpty()) {
throw new IllegalArgumentException("Domains"); throw new IllegalArgumentException("Domains");
if(CdnDomains.isEmpty()) }
if (CdnDomains.isEmpty()) {
throw new IllegalArgumentException("CdnDomains"); throw new IllegalArgumentException("CdnDomains");
}
domains = Domains; domains = Domains;
cdnDomains = CdnDomains; cdnDomains = CdnDomains;
} }
public ChanSite(List<String> Domains) { public ChanSite(List<String> Domains) {
if(Domains.isEmpty()) if (Domains.isEmpty()) {
throw new IllegalArgumentException("Domains"); throw new IllegalArgumentException("Domains");
}
domains = Domains; domains = Domains;
cdnDomains = Domains; cdnDomains = Domains;
} }

View File

@ -164,18 +164,6 @@ public class RipUtils {
if (url == null) url = urlFromSiteDirectoryName(dir, "vinebox", "http://finebox.co/u/", ""); if (url == null) url = urlFromSiteDirectoryName(dir, "vinebox", "http://finebox.co/u/", "");
if (url == null) url = urlFromSiteDirectoryName(dir, "imgbox", "http://imgbox.com/g/", ""); if (url == null) url = urlFromSiteDirectoryName(dir, "imgbox", "http://imgbox.com/g/", "");
if (url == null) url = urlFromSiteDirectoryName(dir, "modelmayhem", "http://www.modelmayhem.com/", ""); if (url == null) url = urlFromSiteDirectoryName(dir, "modelmayhem", "http://www.modelmayhem.com/", "");
/*
if (url == null) url = urlFromSiteDirectoryName(dir, "", "", "");
if (url == null) url = urlFromSiteDirectoryName(dir, "", "", "");
if (url == null) url = urlFromSiteDirectoryName(dir, "", "", "");
if (url == null) url = urlFromSiteDirectoryName(dir, "", "", "");
if (url == null) url = urlFromSiteDirectoryName(dir, "", "", "");
if (url == null) url = urlFromSiteDirectoryName(dir, "", "", "");
if (url == null) url = urlFromSiteDirectoryName(dir, "", "", "");
if (url == null) url = urlFromSiteDirectoryName(dir, "", "", "");
if (url == null) url = urlFromSiteDirectoryName(dir, "", "", "");
if (url == null) url = urlFromSiteDirectoryName(dir, "", "", "");
*/
//if (url == null) url = urlFromSiteDirectoryName(dir, "8muses", "http://www.8muses.com/index/category/", ""); //if (url == null) url = urlFromSiteDirectoryName(dir, "8muses", "http://www.8muses.com/index/category/", "");
return url; return url;
} }
@ -248,8 +236,7 @@ public class RipUtils {
String album = fields.get(1); String album = fields.get(1);
String url = "http://"; String url = "http://";
if ((fields.contains("top") || fields.contains("new")) if ((fields.contains("top") || fields.contains("new"))
&& (fields.contains("year") || fields.contains("month") || fields.contains("week") || fields.contains("all")) && (fields.contains("year") || fields.contains("month") || fields.contains("week") || fields.contains("all"))) {
) {
// Subreddit // Subreddit
fields.remove(0); // "imgur" fields.remove(0); // "imgur"
String sub = ""; String sub = "";

View File

@ -34,7 +34,6 @@ import com.rarchives.ripme.ripper.AbstractRipper;
* Common utility functions used in various places throughout the project. * Common utility functions used in various places throughout the project.
*/ */
public class Utils { public class Utils {
public static final String RIP_DIRECTORY = "rips"; public static final String RIP_DIRECTORY = "rips";
private static final String configFile = "rip.properties"; private static final String configFile = "rip.properties";
private static final Logger logger = Logger.getLogger(Utils.class); private static final Logger logger = Logger.getLogger(Utils.class);
@ -180,7 +179,9 @@ public class Utils {
int nextParam = url.indexOf("&", paramIndex+1); int nextParam = url.indexOf("&", paramIndex+1);
if (nextParam != -1) { if (nextParam != -1) {
String c = "&"; String c = "&";
if(wasFirstParam) c = "?"; if (wasFirstParam) {
c = "?";
}
url = url.substring(0, paramIndex) + c + url.substring(nextParam+1, url.length()); url = url.substring(0, paramIndex) + c + url.substring(nextParam+1, url.length());
} else { } else {
url = url.substring(0, paramIndex); url = url.substring(0, paramIndex);