diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/MyhentaicomicsRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/MyhentaicomicsRipper.java index e206925f..cbe401cb 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/MyhentaicomicsRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/MyhentaicomicsRipper.java @@ -13,8 +13,6 @@ import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; public class MyhentaicomicsRipper extends AbstractHTMLRipper { - private static boolean isTag; - public MyhentaicomicsRipper(URL url) throws IOException { super(url); } @@ -69,7 +67,6 @@ public class MyhentaicomicsRipper extends AbstractHTMLRipper { Pattern pat = Pattern.compile("^https?://myhentaicomics.com/index.php/tag/([0-9]*)/?([a-zA-Z%0-9+?=:]*)?$"); Matcher mat = pat.matcher(url.toExternalForm()); if (mat.matches()) { - isTag = true; return true; } return false; diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/ScrolllerRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/ScrolllerRipper.java index 7e0c1c46..614a575f 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/ScrolllerRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/ScrolllerRipper.java @@ -120,7 +120,7 @@ public class ScrolllerRipper extends AbstractJSONRipper { try { String url = "https://api.scrolller.com/api/v2/graphql"; - URL obj = new URL(url); + URL obj = new URI(url).toURL(); HttpURLConnection conn = (HttpURLConnection) obj.openConnection(); conn.setReadTimeout(5000); conn.addRequestProperty("Accept-Language", "en-US,en;q=0.8"); diff --git a/src/test/java/com/rarchives/ripme/tst/proxyTest.java b/src/test/java/com/rarchives/ripme/tst/proxyTest.java index 72140853..7791290a 100644 --- a/src/test/java/com/rarchives/ripme/tst/proxyTest.java +++ b/src/test/java/com/rarchives/ripme/tst/proxyTest.java @@ -1,6 +1,8 @@ package com.rarchives.ripme.tst; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import com.rarchives.ripme.utils.Proxy; import com.rarchives.ripme.utils.Utils; @@ -14,12 +16,12 @@ public class proxyTest { // This test will only run on machines where the user has added a entry for proxy.socks @Test - public void testSocksProxy() throws IOException { + public void testSocksProxy() throws IOException, URISyntaxException { // Unset proxy before testing System.setProperty("http.proxyHost", ""); System.setProperty("https.proxyHost", ""); System.setProperty("socksProxyHost", ""); - URL url = new URL("https://icanhazip.com"); + URL url = new URI("https://icanhazip.com").toURL(); String proxyConfig = Utils.getConfigString("proxy.socks", ""); if (!proxyConfig.equals("")) { String ip1 = Http.url(url).ignoreContentType().get().text(); @@ -34,12 +36,12 @@ public class proxyTest { // This test will only run on machines where the user has added a entry for proxy.http @Test - public void testHTTPProxy() throws IOException { + public void testHTTPProxy() throws IOException, URISyntaxException { // Unset proxy before testing System.setProperty("http.proxyHost", ""); System.setProperty("https.proxyHost", ""); System.setProperty("socksProxyHost", ""); - URL url = new URL("https://icanhazip.com"); + URL url = new URI("https://icanhazip.com").toURL(); String proxyConfig = Utils.getConfigString("proxy.http", ""); if (!proxyConfig.equals("")) { String ip1 = Http.url(url).ignoreContentType().get().text(); diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ModelxRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ModelxRipperTest.java index 50fec37b..38f572a8 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ModelxRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ModelxRipperTest.java @@ -1,6 +1,8 @@ package com.rarchives.ripme.tst.ripper.rippers; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import com.rarchives.ripme.ripper.rippers.ModelxRipper; @@ -11,11 +13,10 @@ import org.junit.jupiter.api.Test; public class ModelxRipperTest extends RippersTest { @Test @Disabled("ModelxRipper domain has been changes. Commenting to avoid build failure.") - public void testModelxAlbum() throws IOException { - ModelxRipper ripper = new ModelxRipper(new URL( - "http://www.modelx.org/graphis-collection-2002-2016/ai-yuzuki-%e6%9f%9a%e6%9c%88%e3%81%82%e3%81%84-yuzuiro/")); - System.out.println(ripper.getGID(new URL( - "http://www.modelx.org/graphis-collection-2002-2016/ai-yuzuki-%e6%9f%9a%e6%9c%88%e3%81%82%e3%81%84-yuzuiro/"))); + public void testModelxAlbum() throws IOException, URISyntaxException { + URL url = new URI("http://www.modelx.org/graphis-collection-2002-2016/ai-yuzuki-%e6%9f%9a%e6%9c%88%e3%81%82%e3%81%84-yuzuiro/").toURL(); + ModelxRipper ripper = new ModelxRipper(url); + System.out.println(ripper.getGID(url)); testRipper(ripper); } } \ No newline at end of file diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/VscoRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/VscoRipperTest.java index 4fc14e8a..c6ab6a79 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/VscoRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/VscoRipperTest.java @@ -3,7 +3,6 @@ package com.rarchives.ripme.tst.ripper.rippers; import com.rarchives.ripme.ripper.rippers.VscoRipper; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import java.io.IOException;