1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-26 07:14:38 +02:00

coomerPartyrippertest new URI instead of new URL

This commit is contained in:
soloturn
2023-11-18 05:12:33 +01:00
parent d82cae1b78
commit 4a61ff97e5

View File

@@ -8,18 +8,20 @@ import com.rarchives.ripme.ripper.rippers.CoomerPartyRipper;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.io.IOException; import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL; import java.net.URL;
public class CoomerPartyRipperTest extends RippersTest { public class CoomerPartyRipperTest extends RippersTest {
@Test @Test
public void testRip() throws IOException { public void testRip() throws IOException, URISyntaxException {
URL url = new URL("https://coomer.su/onlyfans/user/soogsx"); URL url = new URI("https://coomer.su/onlyfans/user/soogsx").toURL();
CoomerPartyRipper ripper = new CoomerPartyRipper(url); CoomerPartyRipper ripper = new CoomerPartyRipper(url);
testRipper(ripper); testRipper(ripper);
} }
@Test @Test
public void testUrlParsing() throws IOException { public void testUrlParsing() throws IOException, URISyntaxException {
String expectedGid = "onlyfans_soogsx"; String expectedGid = "onlyfans_soogsx";
String[] urls = new String[]{ String[] urls = new String[]{
"https://coomer.su/onlyfans/user/soogsx", // normal url "https://coomer.su/onlyfans/user/soogsx", // normal url
@@ -29,7 +31,7 @@ public class CoomerPartyRipperTest extends RippersTest {
"https://coomer.party/onlyfans/user/soogsx", // alternate domain "https://coomer.party/onlyfans/user/soogsx", // alternate domain
}; };
for (String stringUrl : urls) { for (String stringUrl : urls) {
URL url = new URL(stringUrl); URL url = new URI(stringUrl).toURL();
CoomerPartyRipper ripper = new CoomerPartyRipper(url); CoomerPartyRipper ripper = new CoomerPartyRipper(url);
assertTrue(ripper.canRip(url)); assertTrue(ripper.canRip(url));
assertEquals(expectedGid, ripper.getGID(url)); assertEquals(expectedGid, ripper.getGID(url));