1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-01-17 04:38:18 +01:00

new URI instead of new URL in tests, 7.

This commit is contained in:
soloturn 2023-06-13 06:56:27 +02:00
parent 7f307ba481
commit 78e6e7d51e
9 changed files with 92 additions and 76 deletions

View File

@ -1,6 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers; package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException; import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL; import java.net.URL;
import com.rarchives.ripme.ripper.rippers.ImgboxRipper; import com.rarchives.ripme.ripper.rippers.ImgboxRipper;
@ -11,14 +13,14 @@ import org.junit.jupiter.api.Test;
public class ImgboxRipperTest extends RippersTest { public class ImgboxRipperTest extends RippersTest {
@Test @Test
@Tag("flaky") @Tag("flaky")
public void testImgboxRip() throws IOException { public void testImgboxRip() throws IOException, URISyntaxException {
ImgboxRipper ripper = new ImgboxRipper(new URL("https://imgbox.com/g/FJPF7t26FD")); ImgboxRipper ripper = new ImgboxRipper(new URI("https://imgbox.com/g/FJPF7t26FD").toURL());
testRipper(ripper); testRipper(ripper);
} }
@Test @Test
public void testGetGID() throws IOException { public void testGetGID() throws IOException, URISyntaxException {
URL url = new URL("https://imgbox.com/g/FJPF7t26FD"); URL url = new URI("https://imgbox.com/g/FJPF7t26FD").toURL();
ImgboxRipper ripper = new ImgboxRipper(url); ImgboxRipper ripper = new ImgboxRipper(url);
Assertions.assertEquals("FJPF7t26FD", ripper.getGID(url)); Assertions.assertEquals("FJPF7t26FD", ripper.getGID(url));
} }

View File

@ -10,21 +10,23 @@ import org.junit.jupiter.api.Tag;
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;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class ImgurRipperTest extends RippersTest { public class ImgurRipperTest extends RippersTest {
@Test @Test
public void testImgurURLFailures() throws IOException { public void testImgurURLFailures() throws IOException, URISyntaxException {
List<URL> failURLs = new ArrayList<>(); List<URL> failURLs = new ArrayList<>();
// Imgur urls that should not work // Imgur urls that should not work
failURLs.add(new URL("http://imgur.com")); failURLs.add(new URI("http://imgur.com").toURL());
failURLs.add(new URL("http://imgur.com/")); failURLs.add(new URI("http://imgur.com/").toURL());
failURLs.add(new URL("http://i.imgur.com")); failURLs.add(new URI("http://i.imgur.com").toURL());
failURLs.add(new URL("http://i.imgur.com/")); failURLs.add(new URI("http://i.imgur.com/").toURL());
failURLs.add(new URL("http://imgur.com/image.jpg")); failURLs.add(new URI("http://imgur.com/image.jpg").toURL());
failURLs.add(new URL("http://i.imgur.com/image.jpg")); failURLs.add(new URI("http://i.imgur.com/image.jpg").toURL());
for (URL url : failURLs) { for (URL url : failURLs) {
try { try {
new ImgurRipper(url); new ImgurRipper(url);
@ -37,21 +39,21 @@ public class ImgurRipperTest extends RippersTest {
@Test @Test
@Tag("flaky") @Tag("flaky")
public void testImgurAlbums() throws IOException { public void testImgurAlbums() throws IOException, URISyntaxException {
List<URL> contentURLs = new ArrayList<>(); List<URL> contentURLs = new ArrayList<>();
// URLs that should return more than 1 image // URLs that should return more than 1 image
//contentURLs.add(new URL("http://imgur.com/a/dS9OQ#0")); // Horizontal layout //contentURLs.add(new URI("http://imgur.com/a/dS9OQ#0").toURL()); // Horizontal layout
//contentURLs.add(new URL("http://imgur.com/a/YpsW9#0")); // Grid layout //contentURLs.add(new URI("http://imgur.com/a/YpsW9#0").toURL()); // Grid layout
contentURLs.add(new URL("http://imgur.com/a/WxG6f/layout/vertical#0")); contentURLs.add(new URI("http://imgur.com/a/WxG6f/layout/vertical#0").toURL());
contentURLs.add(new URL("http://imgur.com/a/WxG6f/layout/horizontal#0")); contentURLs.add(new URI("http://imgur.com/a/WxG6f/layout/horizontal#0").toURL());
contentURLs.add(new URL("http://imgur.com/a/WxG6f/layout/grid#0")); contentURLs.add(new URI("http://imgur.com/a/WxG6f/layout/grid#0").toURL());
contentURLs.add(new URL("http://imgur.com/gallery/FmP2o")); // Gallery URL contentURLs.add(new URI("http://imgur.com/gallery/FmP2o").toURL()); // Gallery URL
// Imgur seems not to support URLs with lists of images anymore. // Imgur seems not to support URLs with lists of images anymore.
// contentURLs.add(new // contentURLs.add(new
// URL("http://imgur.com/758qD43,C6iVJex,bP7flAu,J3l85Ri,1U7fhu5,MbuAUCM,JF4vOXQ")); // URL("http://imgur.com/758qD43,C6iVJex,bP7flAu,J3l85Ri,1U7fhu5,MbuAUCM,JF4vOXQ"));
// Sometimes hangs up // Sometimes hangs up
// contentURLs.add(new URL("http://imgur.com/r/nsfw_oc/top/all")); // contentURLs.add(new URI("http://imgur.com/r/nsfw_oc/top/all").toURL());
// contentURLs.add(new URL("http://imgur.com/a/bXQpH")); // Album with // contentURLs.add(new URI("http://imgur.com/a/bXQpH").toURL()); // Album with
// titles/descriptions // titles/descriptions
for (URL url : contentURLs) { for (URL url : contentURLs) {
ImgurRipper ripper = new ImgurRipper(url); ImgurRipper ripper = new ImgurRipper(url);
@ -61,10 +63,10 @@ public class ImgurRipperTest extends RippersTest {
@Test @Test
@Disabled("test or ripper broken") @Disabled("test or ripper broken")
public void testImgurSingleImage() throws IOException { public void testImgurSingleImage() throws IOException, URISyntaxException {
List<URL> contentURLs = new ArrayList<>(); List<URL> contentURLs = new ArrayList<>();
contentURLs.add(new URL("http://imgur.com/qbfcLyG")); // Single image URL contentURLs.add(new URI("http://imgur.com/qbfcLyG").toURL()); // Single image URL
contentURLs.add(new URL("https://imgur.com/KexUO")); // Single image URL contentURLs.add(new URI("https://imgur.com/KexUO").toURL()); // Single image URL
for (URL url : contentURLs) { for (URL url : contentURLs) {
ImgurRipper ripper = new ImgurRipper(url); ImgurRipper ripper = new ImgurRipper(url);
testRipper(ripper); testRipper(ripper);
@ -72,22 +74,22 @@ public class ImgurRipperTest extends RippersTest {
} }
@Test @Test
public void testImgurAlbumWithMoreThan20Pictures() throws IOException { public void testImgurAlbumWithMoreThan20Pictures() throws IOException, URISyntaxException {
ImgurAlbum album = ImgurRipper.getImgurAlbum(new URL("http://imgur.com/a/HUMsq")); ImgurAlbum album = ImgurRipper.getImgurAlbum(new URI("http://imgur.com/a/HUMsq").toURL());
Assertions.assertTrue(album.images.size() >= 20, Assertions.assertTrue(album.images.size() >= 20,
"Failed to find 20 files from " + album.url.toExternalForm() + ", only got " + album.images.size()); "Failed to find 20 files from " + album.url.toExternalForm() + ", only got " + album.images.size());
} }
@Test @Test
public void testImgurAlbumWithMoreThan100Pictures() throws IOException { public void testImgurAlbumWithMoreThan100Pictures() throws IOException, URISyntaxException {
ImgurAlbum album = ImgurRipper.getImgurAlbum(new URL("https://imgur.com/a/HX3JSrD")); ImgurAlbum album = ImgurRipper.getImgurAlbum(new URI("https://imgur.com/a/HX3JSrD").toURL());
Assertions.assertTrue(album.images.size() >= 100, Assertions.assertTrue(album.images.size() >= 100,
"Failed to find 100 files from " + album.url.toExternalForm() + ", only got " + album.images.size()); "Failed to find 100 files from " + album.url.toExternalForm() + ", only got " + album.images.size());
} }
@Test @Test
public void testImgurVideoFromGetFilesFromURL() throws Exception { public void testImgurVideoFromGetFilesFromURL() throws Exception {
List<URL> urls = RipUtils.getFilesFromURL(new URL("https://i.imgur.com/4TtwxRN.gifv")); List<URL> urls = RipUtils.getFilesFromURL(new URI("https://i.imgur.com/4TtwxRN.gifv").toURL());
Assertions.assertEquals("https://i.imgur.com/4TtwxRN.mp4", urls.get(0).toExternalForm()); Assertions.assertEquals("https://i.imgur.com/4TtwxRN.mp4", urls.get(0).toExternalForm());
} }
@ -97,7 +99,7 @@ public class ImgurRipperTest extends RippersTest {
* "over capacity" warning on the page. // I wonder if our testing automation is * "over capacity" warning on the page. // I wonder if our testing automation is
* what is putting this album over capacity? // See issue #376. public void * what is putting this album over capacity? // See issue #376. public void
* testImgurAlbumWithMoreThan1000Pictures() throws IOException { ImgurAlbum * testImgurAlbumWithMoreThan1000Pictures() throws IOException { ImgurAlbum
* album = ImgurRipper.getImgurAlbum(new URL("http://imgur.com/a/vsuh5")); * album = ImgurRipper.getImgurAlbum(new URI("http://imgur.com/a/vsuh5").toURL());
* assertTrue("Failed to find 1000 files from " + album.url.toExternalForm() + * assertTrue("Failed to find 1000 files from " + album.url.toExternalForm() +
* ", only got " + album.images.size(), album.images.size() >= 1000); } * ", only got " + album.images.size(), album.images.size() >= 1000); }
*/ */

View File

@ -7,6 +7,8 @@ import org.junit.jupiter.api.Tag;
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;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@ -15,19 +17,19 @@ import java.util.Map;
public class InstagramRipperTest extends RippersTest { public class InstagramRipperTest extends RippersTest {
@Test @Test
public void testInstagramGID() throws IOException { public void testInstagramGID() throws IOException, URISyntaxException {
Map<URL, String> testURLs = new HashMap<>(); Map<URL, String> testURLs = new HashMap<>();
testURLs.put(new URL("http://instagram.com/Test_User"), "Test_User"); testURLs.put(new URI("http://instagram.com/Test_User").toURL(), "Test_User");
testURLs.put(new URL("http://instagram.com/_test_user_"), "_test_user_"); testURLs.put(new URI("http://instagram.com/_test_user_").toURL(), "_test_user_");
testURLs.put(new URL("http://instagram.com/_test_user_/?pinned"), "_test_user__pinned"); testURLs.put(new URI("http://instagram.com/_test_user_/?pinned").toURL(), "_test_user__pinned");
testURLs.put(new URL("http://instagram.com/stories/_test_user_/"), "_test_user__stories"); testURLs.put(new URI("http://instagram.com/stories/_test_user_/").toURL(), "_test_user__stories");
testURLs.put(new URL("http://instagram.com/_test_user_/tagged"), "_test_user__tagged"); testURLs.put(new URI("http://instagram.com/_test_user_/tagged").toURL(), "_test_user__tagged");
testURLs.put(new URL("http://instagram.com/_test_user_/channel"), "_test_user__igtv"); testURLs.put(new URI("http://instagram.com/_test_user_/channel").toURL(), "_test_user__igtv");
testURLs.put(new URL("http://instagram.com/explore/tags/test_your_tag"), "tag_test_your_tag"); testURLs.put(new URI("http://instagram.com/explore/tags/test_your_tag").toURL(), "tag_test_your_tag");
testURLs.put(new URL("https://www.instagram.com/p/BZ4egP7njW5/?hl=en"), "post_BZ4egP7njW5"); testURLs.put(new URI("https://www.instagram.com/p/BZ4egP7njW5/?hl=en").toURL(), "post_BZ4egP7njW5");
testURLs.put(new URL("https://www.instagram.com/p/BZ4egP7njW5"), "post_BZ4egP7njW5"); testURLs.put(new URI("https://www.instagram.com/p/BZ4egP7njW5").toURL(), "post_BZ4egP7njW5");
testURLs.put(new URL("https://www.instagram.com/p/BaNPpaHn2zU/?taken-by=hilaryduff"), "post_BaNPpaHn2zU"); testURLs.put(new URI("https://www.instagram.com/p/BaNPpaHn2zU/?taken-by=hilaryduff").toURL(), "post_BaNPpaHn2zU");
testURLs.put(new URL("https://www.instagram.com/p/BaNPpaHn2zU/"), "post_BaNPpaHn2zU"); testURLs.put(new URI("https://www.instagram.com/p/BaNPpaHn2zU/").toURL(), "post_BaNPpaHn2zU");
for (URL url : testURLs.keySet()) { for (URL url : testURLs.keySet()) {
InstagramRipper ripper = new InstagramRipper(url); InstagramRipper ripper = new InstagramRipper(url);
ripper.setup(); ripper.setup();
@ -38,10 +40,10 @@ public class InstagramRipperTest extends RippersTest {
@Test @Test
@Disabled("Ripper broken for single items") @Disabled("Ripper broken for single items")
public void testInstagramSingle() throws IOException { public void testInstagramSingle() throws IOException, URISyntaxException {
List<URL> contentURLs = new ArrayList<>(); List<URL> contentURLs = new ArrayList<>();
contentURLs.add(new URL("https://www.instagram.com/p/BaNPpaHn2zU/?hl=en")); contentURLs.add(new URI("https://www.instagram.com/p/BaNPpaHn2zU/?hl=en").toURL());
contentURLs.add(new URL("https://www.instagram.com/p/BaNPpaHn2zU/")); contentURLs.add(new URI("https://www.instagram.com/p/BaNPpaHn2zU/").toURL());
for (URL url : contentURLs) { for (URL url : contentURLs) {
InstagramRipper ripper = new InstagramRipper(url); InstagramRipper ripper = new InstagramRipper(url);
testRipper(ripper); testRipper(ripper);
@ -50,10 +52,10 @@ public class InstagramRipperTest extends RippersTest {
@Test @Test
@Tag("flaky") @Tag("flaky")
public void testInstagramAlbums() throws IOException { public void testInstagramAlbums() throws IOException, URISyntaxException {
// do not test, in case of rate limit 200/hr since 2021. see // do not test, in case of rate limit 200/hr since 2021. see
// https://github.com/ripmeapp2/ripme/issues/32 // https://github.com/ripmeapp2/ripme/issues/32
URL url = new URL("https://www.instagram.com/Test_User/"); URL url = new URI("https://www.instagram.com/Test_User/").toURL();
InstagramRipper ripper = new InstagramRipper(url); InstagramRipper ripper = new InstagramRipper(url);
testRipper(ripper); testRipper(ripper);
} }

View File

@ -1,7 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers; package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URI;
import java.net.URISyntaxException;
import com.rarchives.ripme.ripper.rippers.JagodibujaRipper; import com.rarchives.ripme.ripper.rippers.JagodibujaRipper;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
@ -10,9 +11,9 @@ import org.junit.jupiter.api.Test;
public class JagodibujaRipperTest extends RippersTest { public class JagodibujaRipperTest extends RippersTest {
@Test @Test
@Disabled("fails on github ubuntu automated PR check 2020-07-29") @Disabled("fails on github ubuntu automated PR check 2020-07-29")
public void testJagodibujaRipper() throws IOException { public void testJagodibujaRipper() throws IOException, URISyntaxException {
// a photo set // a photo set
JagodibujaRipper ripper = new JagodibujaRipper(new URL("http://www.jagodibuja.com/comic-in-me/")); JagodibujaRipper ripper = new JagodibujaRipper(new URI("http://www.jagodibuja.com/comic-in-me/").toURL());
testRipper(ripper); testRipper(ripper);
} }
} }

View File

@ -1,6 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers; package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException; import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL; import java.net.URL;
import com.rarchives.ripme.ripper.rippers.KingcomixRipper; import com.rarchives.ripme.ripper.rippers.KingcomixRipper;
@ -13,14 +15,14 @@ public class KingcomixRipperTest extends RippersTest {
@Test @Test
@Disabled("test or ripper broken") @Disabled("test or ripper broken")
public void testRip() throws IOException { public void testRip() throws IOException, URISyntaxException {
KingcomixRipper ripper = new KingcomixRipper(new URL("https://kingcomix.com/aunt-cumming-tracy-scops/")); KingcomixRipper ripper = new KingcomixRipper(new URI("https://kingcomix.com/aunt-cumming-tracy-scops/").toURL());
testRipper(ripper); testRipper(ripper);
} }
@Test @Test
public void testGetGID() throws IOException { public void testGetGID() throws IOException, URISyntaxException {
URL url = new URL("https://kingcomix.com/aunt-cumming-tracy-scops/"); URL url = new URI("https://kingcomix.com/aunt-cumming-tracy-scops/").toURL();
KingcomixRipper ripper = new KingcomixRipper(url); KingcomixRipper ripper = new KingcomixRipper(url);
Assertions.assertEquals("aunt-cumming-tracy-scops", ripper.getGID(url)); Assertions.assertEquals("aunt-cumming-tracy-scops", ripper.getGID(url));
} }

View File

@ -1,7 +1,9 @@
package com.rarchives.ripme.tst.ripper.rippers; package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URI;
import java.net.URISyntaxException;
import com.rarchives.ripme.ripper.rippers.ListalRipper; import com.rarchives.ripme.ripper.rippers.ListalRipper;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -11,9 +13,9 @@ public class ListalRipperTest extends RippersTest {
* Test for list type url. * Test for list type url.
*/ */
@Test @Test
public void testPictures() throws IOException { public void testPictures() throws IOException, URISyntaxException {
ListalRipper ripper = ListalRipper ripper =
new ListalRipper(new URL("https://www.listal.com/emma-stone_iii/pictures")); new ListalRipper(new URI("https://www.listal.com/emma-stone_iii/pictures").toURL());
testRipper(ripper); testRipper(ripper);
} }
@ -21,9 +23,9 @@ public class ListalRipperTest extends RippersTest {
* Test for list type url. * Test for list type url.
*/ */
@Test @Test
public void testRipListType() throws IOException { public void testRipListType() throws IOException, URISyntaxException {
ListalRipper ripper = ListalRipper ripper =
new ListalRipper(new URL("https://www.listal.com/list/evolution-emma-stone")); new ListalRipper(new URI("https://www.listal.com/list/evolution-emma-stone").toURL());
testRipper(ripper); testRipper(ripper);
} }
@ -31,9 +33,9 @@ public class ListalRipperTest extends RippersTest {
* Test for folder type url. * Test for folder type url.
*/ */
@Test @Test
public void testRipFolderType() throws IOException { public void testRipFolderType() throws IOException, URISyntaxException {
ListalRipper ripper = ListalRipper ripper =
new ListalRipper(new URL("https://www.listal.com/chet-atkins/pictures")); new ListalRipper(new URI("https://www.listal.com/chet-atkins/pictures").toURL());
testRipper(ripper); testRipper(ripper);
} }

View File

@ -1,6 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers; package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException; import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL; import java.net.URL;
import com.rarchives.ripme.ripper.rippers.LusciousRipper; import com.rarchives.ripme.ripper.rippers.LusciousRipper;
@ -11,28 +13,28 @@ import org.junit.jupiter.api.Test;
public class LusciousRipperTest extends RippersTest { public class LusciousRipperTest extends RippersTest {
@Test @Test
@Disabled("test or ripper broken") @Disabled("test or ripper broken")
public void testPahealRipper() throws IOException { public void testPahealRipper() throws IOException, URISyntaxException {
// a photo set // a photo set
LusciousRipper ripper = new LusciousRipper( LusciousRipper ripper = new LusciousRipper(
new URL("https://luscious.net/albums/h-na-alice-wa-suki-desu-ka-do-you-like-alice-when_321609/")); new URI("https://luscious.net/albums/h-na-alice-wa-suki-desu-ka-do-you-like-alice-when_321609/").toURL());
testRipper(ripper); testRipper(ripper);
} }
@Test @Test
public void testGetGID() throws IOException { public void testGetGID() throws IOException, URISyntaxException {
URL url = new URL("https://luscious.net/albums/h-na-alice-wa-suki-desu-ka-do-you-like-alice-when_321609/"); URL url = new URI("https://luscious.net/albums/h-na-alice-wa-suki-desu-ka-do-you-like-alice-when_321609/").toURL();
LusciousRipper ripper = new LusciousRipper(url); LusciousRipper ripper = new LusciousRipper(url);
Assertions.assertEquals("h-na-alice-wa-suki-desu-ka-do-you-like-alice-when_321609", ripper.getGID(url)); Assertions.assertEquals("h-na-alice-wa-suki-desu-ka-do-you-like-alice-when_321609", ripper.getGID(url));
} }
@Test @Test
@Disabled("test or ripper broken") @Disabled("test or ripper broken")
public void testGetNextPage() throws IOException { public void testGetNextPage() throws IOException, URISyntaxException {
URL multiPageAlbumUrl = new URL("https://luscious.net/albums/women-of-color_58/"); URL multiPageAlbumUrl = new URI("https://luscious.net/albums/women-of-color_58/").toURL();
LusciousRipper multiPageRipper = new LusciousRipper(multiPageAlbumUrl); LusciousRipper multiPageRipper = new LusciousRipper(multiPageAlbumUrl);
assert (multiPageRipper.getNextPage(multiPageRipper.getFirstPage()) != null); assert (multiPageRipper.getNextPage(multiPageRipper.getFirstPage()) != null);
URL singlePageAlbumUrl = new URL("https://members.luscious.net/albums/bakaneko-navidarks_332097/"); URL singlePageAlbumUrl = new URI("https://members.luscious.net/albums/bakaneko-navidarks_332097/").toURL();
LusciousRipper singlePageRipper = new LusciousRipper(singlePageAlbumUrl); LusciousRipper singlePageRipper = new LusciousRipper(singlePageAlbumUrl);
try { try {
singlePageRipper.getNextPage(singlePageRipper.getFirstPage()); singlePageRipper.getNextPage(singlePageRipper.getFirstPage());

View File

@ -4,17 +4,18 @@ package com.rarchives.ripme.tst.ripper.rippers;
import com.rarchives.ripme.ripper.rippers.MangadexRipper; import com.rarchives.ripme.ripper.rippers.MangadexRipper;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URI;
import java.net.URISyntaxException;
public class MangadexRipperTest extends RippersTest{ public class MangadexRipperTest extends RippersTest{
public void testRip() throws IOException { public void testRip() throws IOException, URISyntaxException {
MangadexRipper ripper = new MangadexRipper(new URL("https://mangadex.org/chapter/467904/")); MangadexRipper ripper = new MangadexRipper(new URI("https://mangadex.org/chapter/467904/").toURL());
testRipper(ripper); testRipper(ripper);
} }
public class testMangaRip extends RippersTest{ public class testMangaRip extends RippersTest{
public void testRip() throws IOException { public void testRip() throws IOException, URISyntaxException {
MangadexRipper ripper = new MangadexRipper(new URL("https://mangadex.org/title/44625/this-croc-will-die-in-100-days")); MangadexRipper ripper = new MangadexRipper(new URI("https://mangadex.org/title/44625/this-croc-will-die-in-100-days").toURL());
testRipper(ripper); testRipper(ripper);
} }
} }

View File

@ -1,6 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers; package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException; import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL; import java.net.URL;
import com.rarchives.ripme.ripper.rippers.ManganeloRipper; import com.rarchives.ripme.ripper.rippers.ManganeloRipper;
@ -11,14 +13,14 @@ import org.junit.jupiter.api.Test;
public class ManganeloRipperTest extends RippersTest { public class ManganeloRipperTest extends RippersTest {
@Test @Test
@Disabled("no images found, test or ripper broken") @Disabled("no images found, test or ripper broken")
public void testRip() throws IOException { public void testRip() throws IOException, URISyntaxException {
ManganeloRipper ripper = new ManganeloRipper(new URL("https://manganelo.com/manga/demonic_housekeeper")); ManganeloRipper ripper = new ManganeloRipper(new URI("https://manganelo.com/manga/demonic_housekeeper").toURL());
testRipper(ripper); testRipper(ripper);
} }
@Test @Test
public void testGetGID() throws IOException { public void testGetGID() throws IOException, URISyntaxException {
URL url = new URL("https://manganelo.com/manga/demonic_housekeeper"); URL url = new URI("https://manganelo.com/manga/demonic_housekeeper").toURL();
ManganeloRipper ripper = new ManganeloRipper(url); ManganeloRipper ripper = new ManganeloRipper(url);
Assertions.assertEquals("demonic_housekeeper", ripper.getGID(url)); Assertions.assertEquals("demonic_housekeeper", ripper.getGID(url));
} }