diff --git a/src/main/java/lau/ZBChecker/Main.java b/src/main/java/lau/ZBChecker/Main.java index 42ff838..03c12b7 100644 --- a/src/main/java/lau/ZBChecker/Main.java +++ b/src/main/java/lau/ZBChecker/Main.java @@ -23,8 +23,8 @@ public class Main { public static boolean isCloudMode = false; public static transient Log log = LogFactory.getLog("Main"); public static long totalTriedTimes = 0; - public static List proxyList = new ArrayList(); - public static List comboList = new ArrayList(); + public static List proxyList = new ArrayList<>(); + public static List comboList = new ArrayList<>(); public static Counter counter = new Counter(); public static String fileFolderName = "./results/" + (new Date()).toString().replace(':', '-'); public static int totalThreads = 0; @@ -41,6 +41,7 @@ public static void main(String[] args) { " / /__ | |_| | | |___ | | | | | |___ | |___ | | \\ \\ | |___ | | \\ \\ \n" + "/_____| |_____/ \\_____| |_| |_| |_____| \\_____| |_| \\_\\ |_____| |_| \\_\\|@ \n" + "@|yellow By Github@layou233|@\n")); + UpdateCheck.updateCheck(); config.loadConfig(); String text = LoadFileResource.loadFile("combos.txt"); if (!Objects.equals(text, "")) isCloudMode = true; @@ -60,8 +61,8 @@ public static void main(String[] args) { log.fatal(config.proxyFile.getName() + " is not found. Please recheck your proxy file name!"); System.exit(0); } + System.out.println(ansi().render("@|green Successfully loaded " + Main.proxyList.size() + " proxies.|@")); } - System.out.println(ansi().render("@|green Successfully loaded " + Main.proxyList.size() + " proxies.|@")); // Load combos try { @@ -71,7 +72,7 @@ public static void main(String[] args) { log.fatal(config.comboFile.getName() + " is not found. Please recheck your combo file name!"); System.exit(0); } - System.out.println(ansi().render("@|green Successfully loaded " + comboList.size() + " combos.|@\n")); + log.warn(ansi().render("@|green Successfully loaded " + comboList.size() + " combos.|@\n")); // Judge if there is no proxy/combo if (comboList.size() == 0) { diff --git a/src/main/java/lau/ZBChecker/UpdateCheck.java b/src/main/java/lau/ZBChecker/UpdateCheck.java index 1a736f0..f5dc212 100644 --- a/src/main/java/lau/ZBChecker/UpdateCheck.java +++ b/src/main/java/lau/ZBChecker/UpdateCheck.java @@ -15,17 +15,17 @@ public static void updateCheck() { System.out.println("Version " + version); String remoteVersion; try { - CloseableHttpResponse httpClient = HttpClients.createDefault().execute(new HttpGet("https://raw.githubusercontent.com/layou233/NovelDL/master/src/main/resources/version.txt")); + CloseableHttpResponse httpClient = HttpClients.createDefault().execute(new HttpGet("https://raw.githubusercontent.com/layou233/ZBChecker/master/src/main/resources/version.txt")); remoteVersion = EntityUtils.toString(httpClient.getEntity(), "UTF-8"); httpClient.close(); } catch (IOException e) { System.out.println("FAILED TO CHECK FOR UPDATES.\n" + - "You can check it yourself at https://github.com/layou233/NovelDL/releases\n"); + "You can check it yourself at https://github.com/layou233/ZBChecker/releases\n"); return; } if (version.equals(remoteVersion)) System.out.println("Nice! You are using the latest version!\n"); else System.out.println("THE ZBChecker YOU ARE CURRENTLY USING HAS BEEN OUTDATED!\n" + - "Check out newer versions at https://github.com/layou233/NovelDL/releases\n"); + "Check out newer versions at https://github.com/layou233/ZBChecker/releases\n"); } } \ No newline at end of file diff --git a/src/main/java/lau/ZBChecker/threads/RefreshApiProxyThread.java b/src/main/java/lau/ZBChecker/threads/RefreshApiProxyThread.java index 374f34c..9687ea6 100644 --- a/src/main/java/lau/ZBChecker/threads/RefreshApiProxyThread.java +++ b/src/main/java/lau/ZBChecker/threads/RefreshApiProxyThread.java @@ -9,17 +9,19 @@ import java.io.IOException; import java.util.Arrays; +import static org.fusesource.jansi.Ansi.ansi; + public class RefreshApiProxyThread extends Thread { + protected transient static Log log = LogFactory.getLog("RefreshApiProxyThread"); public static void loadProxyFromApi() { - Log log = LogFactory.getLog("RefreshApiProxyThread"); try { Main.proxyList = Arrays.asList(Get.get(Main.config.proxyApi, null, null).trim().replace("\r\n", "\n").replace("\r", "\n").split("\n")); } catch (IOException e) { e.printStackTrace(); - log.error("Fail to load proxies from API. Please restart."); + log.error(ansi().render("@|red Fail to load proxies from API. Please restart.|@")); System.exit(0); } - log.info("Successfully loaded " + Main.proxyList.size() + " proxies.\n"); + log.warn(ansi().render("@|green Successfully loaded " + Main.proxyList.size() + " proxies |@@|cyan from API.|@")); } @Override