1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-09-02 10:23:47 +02:00

new URI instead of new URL in tests, 12.

This commit is contained in:
soloturn
2023-06-13 07:59:27 +02:00
parent d501578a8e
commit 44513b15a3
14 changed files with 90 additions and 71 deletions

View File

@@ -52,17 +52,17 @@ public class ChanRipperTest extends RippersTest {
@Test
public void testChanRipper() throws IOException, URISyntaxException {
List<URL> contentURLs = new ArrayList<>();
contentURLs.add(new URI(getRandomThreadDesuarchive()).toURL());
contentURLs.add(getRandomThreadDesuarchive());
for (URL url : contentURLs) {
ChanRipper ripper = new ChanRipper(url);
testChanRipper(ripper);
}
}
public String getRandomThreadDesuarchive() throws URISyntaxException {
public URL getRandomThreadDesuarchive() throws URISyntaxException {
try {
Document doc = Http.url(new URI("https://desuarchive.org/wsg/").toURL()).get();
return doc.select("div.post_data > a").first().attr("href");
return new URI(doc.select("div.post_data > a").first().attr("href")).toURL();
} catch (IOException e) {
e.printStackTrace();
}

View File

@@ -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.PicstatioRipper;
@@ -9,13 +11,14 @@ import org.junit.jupiter.api.Test;
public class PicstatioRipperTest extends RippersTest {
public void testRip() throws IOException {
PicstatioRipper ripper = new PicstatioRipper(new URL("https://www.picstatio.com/aerial-view-wallpapers"));
public void testRip() throws IOException, URISyntaxException {
PicstatioRipper ripper = new PicstatioRipper(new URI("https://www.picstatio.com/aerial-view-wallpapers").toURL());
testRipper(ripper);
}
@Test
public void testGID() throws IOException {
PicstatioRipper ripper = new PicstatioRipper(new URL("https://www.picstatio.com/aerial-view-wallpapers"));
Assertions.assertEquals("aerial-view-wallpapers", ripper.getGID(new URL("https://www.picstatio.com/aerial-view-wallpapers")));
public void testGID() throws IOException, URISyntaxException {
URL url = new URI("https://www.picstatio.com/aerial-view-wallpapers").toURL();
PicstatioRipper ripper = new PicstatioRipper(url);
Assertions.assertEquals("aerial-view-wallpapers", ripper.getGID(url));
}
}

View File

@@ -1,13 +1,14 @@
package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import com.rarchives.ripme.ripper.rippers.PornpicsRipper;
public class PornpicsRipperTest extends RippersTest {
public void testRip() throws IOException {
PornpicsRipper ripper = new PornpicsRipper(new URL("https://www.pornpics.com/galleries/pornstar-dahlia-sky-takes-a-fat-cock-in-her-butthole-wearing-fishnet-stockings/"));
public void testRip() throws IOException, URISyntaxException {
PornpicsRipper ripper = new PornpicsRipper(new URI("https://www.pornpics.com/galleries/pornstar-dahlia-sky-takes-a-fat-cock-in-her-butthole-wearing-fishnet-stockings/").toURL());
testRipper(ripper);
}
}

View File

@@ -6,21 +6,22 @@ import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
public class SoundgasmRipperTest extends RippersTest {
@Test
@Tag("flaky")
public void testSoundgasmURLs() throws IOException {
SoundgasmRipper ripper = new SoundgasmRipper(new URL("https://soundgasm.net/u/_Firefly_xoxo/Rambles-with-my-Lovense"));
public void testSoundgasmURLs() throws IOException, URISyntaxException {
SoundgasmRipper ripper = new SoundgasmRipper(new URI("https://soundgasm.net/u/_Firefly_xoxo/Rambles-with-my-Lovense").toURL());
testRipper(ripper);
}
@Test
@Tag("flaky")
public void testRedditSoundgasmURL() throws IOException {
RedditRipper ripper = new RedditRipper(new URL("https://www.reddit.com/r/gonewildaudio/comments/kn1bvj/f4m_mistress_controlled_my_lovense_while_i_tried/"));
public void testRedditSoundgasmURL() throws IOException, URISyntaxException {
RedditRipper ripper = new RedditRipper(new URI("https://www.reddit.com/r/gonewildaudio/comments/kn1bvj/f4m_mistress_controlled_my_lovense_while_i_tried/").toURL());
testRipper(ripper);
}
}

View File

@@ -30,6 +30,8 @@ import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
/**
@@ -45,17 +47,17 @@ public class ThechiveRipperTest extends RippersTest {
*/
@Test
@Tag("flaky")
public void testTheChiveRip() throws IOException {
ThechiveRipper ripper = new ThechiveRipper(new URL(
"https://thechive.com/2019/03/16/beautiful-badasses-lookin-good-in-and-out-of-uniform-35-photos/"));
public void testTheChiveRip() throws IOException, URISyntaxException {
ThechiveRipper ripper = new ThechiveRipper(new URI(
"https://thechive.com/2019/03/16/beautiful-badasses-lookin-good-in-and-out-of-uniform-35-photos/").toURL());
testRipper(ripper);
}
@Test
@Tag("flaky")
public void testTheChiveGif() throws IOException {
public void testTheChiveGif() throws IOException, URISyntaxException {
ThechiveRipper ripper = new ThechiveRipper(
new URL("https://thechive.com/2019/03/14/dont-tease-me-just-squeeze-me-20-gifs/"));
new URI("https://thechive.com/2019/03/14/dont-tease-me-just-squeeze-me-20-gifs/").toURL());
testRipper(ripper);
}
@@ -64,8 +66,8 @@ public class ThechiveRipperTest extends RippersTest {
*/
@Test
@Tag("flaky")
public void testIDotThechive() throws IOException {
ThechiveRipper ripper = new ThechiveRipper(new URL("https://i.thechive.com/witcheva"));
public void testIDotThechive() throws IOException, URISyntaxException {
ThechiveRipper ripper = new ThechiveRipper(new URI("https://i.thechive.com/witcheva").toURL());
testRipper(ripper);
}

View File

@@ -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.TheyiffgalleryRipper;
@@ -11,14 +13,14 @@ import org.junit.jupiter.api.Test;
public class TheyiffgalleryRipperTest extends RippersTest {
@Test
@Tag("flaky")
public void testTheyiffgallery() throws IOException {
TheyiffgalleryRipper ripper = new TheyiffgalleryRipper(new URL("https://theyiffgallery.com/index?/category/4303"));
public void testTheyiffgallery() throws IOException, URISyntaxException {
TheyiffgalleryRipper ripper = new TheyiffgalleryRipper(new URI("https://theyiffgallery.com/index?/category/4303").toURL());
testRipper(ripper);
}
@Test
public void testGetGID() throws IOException {
URL url = new URL("https://theyiffgallery.com/index?/category/4303");
public void testGetGID() throws IOException, URISyntaxException {
URL url = new URI("https://theyiffgallery.com/index?/category/4303").toURL();
TheyiffgalleryRipper ripper = new TheyiffgalleryRipper(url);
Assertions.assertEquals("4303", ripper.getGID(url));
}

View File

@@ -1,7 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import com.rarchives.ripme.ripper.rippers.TsuminoRipper;
@@ -15,14 +16,14 @@ import org.junit.jupiter.api.Test;
public class TsuminoRipperTest extends RippersTest {
@Test
@Disabled("Broken ripper")
public void testTsuminoRipper() throws IOException {
TsuminoRipper ripper = new TsuminoRipper(new URL("http://www.tsumino.com/Book/Info/43528/sore-wa-kurokute-suketeita-what-s-tight-and-black-and-sheer-all-over-"));
public void testTsuminoRipper() throws IOException, URISyntaxException {
TsuminoRipper ripper = new TsuminoRipper(new URI("http://www.tsumino.com/Book/Info/43528/sore-wa-kurokute-suketeita-what-s-tight-and-black-and-sheer-all-over-").toURL());
testRipper(ripper);
}
@Test
@Disabled("Broken ripper")
public void testTagBlackList() throws IOException {
TsuminoRipper ripper = new TsuminoRipper(new URL("http://www.tsumino.com/Book/Info/43528/sore-wa-kurokute-suketeita-what-s-tight-and-black-and-sheer-all-over-"));
public void testTagBlackList() throws IOException, URISyntaxException {
TsuminoRipper ripper = new TsuminoRipper(new URI("http://www.tsumino.com/Book/Info/43528/sore-wa-kurokute-suketeita-what-s-tight-and-black-and-sheer-all-over-").toURL());
Document doc = ripper.getFirstPage();
List<String> tagsOnPage = ripper.getTags(doc);
String[] tags1 = {"test", "one", "Smell"};

View File

@@ -2,7 +2,8 @@
package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import com.rarchives.ripme.ripper.rippers.TumblrRipper;
@@ -12,30 +13,30 @@ import org.junit.jupiter.api.Test;
public class TumblrRipperTest extends RippersTest {
@Test
@Disabled
public void testTumblrFullRip() throws IOException {
TumblrRipper ripper = new TumblrRipper(new URL("http://wrouinr.tumblr.com"));
public void testTumblrFullRip() throws IOException, URISyntaxException {
TumblrRipper ripper = new TumblrRipper(new URI("http://wrouinr.tumblr.com").toURL());
testRipper(ripper);
}
@Test
@Disabled
public void testTumblrTagRip() throws IOException {
TumblrRipper ripper = new TumblrRipper(new URL("https://these-are-my-b-sides.tumblr.com/tagged/boobs"));
public void testTumblrTagRip() throws IOException, URISyntaxException {
TumblrRipper ripper = new TumblrRipper(new URI("https://these-are-my-b-sides.tumblr.com/tagged/boobs").toURL());
testRipper(ripper);
}
@Test
@Disabled
public void testTumblrPostRip() throws IOException {
TumblrRipper ripper = new TumblrRipper(new URL("http://sadbaffoon.tumblr.com/post/132045920789/what-a-hoe"));
public void testTumblrPostRip() throws IOException, URISyntaxException {
TumblrRipper ripper = new TumblrRipper(new URI("http://sadbaffoon.tumblr.com/post/132045920789/what-a-hoe").toURL());
testRipper(ripper);
}
@Test
@Disabled("Commented out because the test link is 404ing")
public void testEmbeddedImage() throws IOException {
public void testEmbeddedImage() throws IOException, URISyntaxException {
TumblrRipper ripper = new TumblrRipper(
new URL("https://these-are-my-b-sides.tumblr.com/post/178225921524/this-was-fun"));
new URI("https://these-are-my-b-sides.tumblr.com/post/178225921524/this-was-fun").toURL());
testRipper(ripper);
}
}

View File

@@ -1,7 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import com.rarchives.ripme.ripper.rippers.TwitterRipper;
@@ -11,16 +12,16 @@ import org.junit.jupiter.api.Test;
public class TwitterRipperTest extends RippersTest {
@Test
@Tag("flaky")
public void testTwitterUserRip() throws IOException {
TwitterRipper ripper = new TwitterRipper(new URL("https://twitter.com/danngamber01/media"));
public void testTwitterUserRip() throws IOException, URISyntaxException {
TwitterRipper ripper = new TwitterRipper(new URI("https://twitter.com/danngamber01/media").toURL());
testRipper(ripper);
}
@Test
@Tag("flaky")
public void testTwitterSearchRip() throws IOException {
public void testTwitterSearchRip() throws IOException, URISyntaxException {
TwitterRipper ripper = new TwitterRipper(
new URL("https://twitter.com/search?f=tweets&q=from%3Aalinalixxx%20filter%3Aimages&src=typd"));
new URI("https://twitter.com/search?f=tweets&q=from%3Aalinalixxx%20filter%3Aimages&src=typd").toURL());
testRipper(ripper);
}

View File

@@ -1,7 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import com.rarchives.ripme.ripper.rippers.TwodgalleriesRipper;
@@ -11,9 +12,9 @@ import org.junit.jupiter.api.Test;
public class TwodgalleriesRipperTest extends RippersTest {
@Test
@Disabled("https://github.com/RipMeApp/ripme/issues/182")
public void testTwodgalleriesRip() throws IOException {
public void testTwodgalleriesRip() throws IOException, URISyntaxException {
TwodgalleriesRipper ripper = new TwodgalleriesRipper(
new URL("http://www.2dgalleries.com/artist/regis-loisel-6477"));
new URI("http://www.2dgalleries.com/artist/regis-loisel-6477").toURL());
testRipper(ripper);
}

View File

@@ -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.VidbleRipper;
@@ -9,14 +11,14 @@ import org.junit.jupiter.api.Test;
public class VidbleRipperTest extends RippersTest {
@Test
public void testVidbleRip() throws IOException {
VidbleRipper ripper = new VidbleRipper(new URL("http://www.vidble.com/album/y1oyh3zd"));
public void testVidbleRip() throws IOException, URISyntaxException {
VidbleRipper ripper = new VidbleRipper(new URI("http://www.vidble.com/album/y1oyh3zd").toURL());
testRipper(ripper);
}
@Test
public void testGetGID() throws IOException {
URL url = new URL("http://www.vidble.com/album/y1oyh3zd");
public void testGetGID() throws IOException, URISyntaxException {
URL url = new URI("http://www.vidble.com/album/y1oyh3zd").toURL();
VidbleRipper ripper = new VidbleRipper(url);
Assertions.assertEquals("y1oyh3zd", ripper.getGID(url));
}

View File

@@ -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 java.util.ArrayList;
import java.util.List;
@@ -40,9 +42,9 @@ public class VideoRippersTest extends RippersTest {
@Test
@Disabled("Test disbaled. See https://github.com/RipMeApp/ripme/issues/574")
public void testTwitchVideoRipper() throws IOException {
public void testTwitchVideoRipper() throws IOException, URISyntaxException {
List<URL> contentURLs = new ArrayList<>();
contentURLs.add(new URL("https://clips.twitch.tv/FaithfulIncredulousPotTBCheesePull"));
contentURLs.add(new URI("https://clips.twitch.tv/FaithfulIncredulousPotTBCheesePull").toURL());
for (URL url : contentURLs) {
// TwitchVideoRipper ripper = new TwitchVideoRipper(url);
// videoTestHelper(ripper);
@@ -51,18 +53,18 @@ public class VideoRippersTest extends RippersTest {
@Test
@Disabled("Test disabled see https://github.com/RipMeApp/ripme/issues/1095")
public void testPornhubRipper() throws IOException {
public void testPornhubRipper() throws IOException, URISyntaxException {
List<URL> contentURLs = new ArrayList<>();
contentURLs.add(new URL("https://www.pornhub.com/view_video.php?viewkey=ph5a329fa707269"));
contentURLs.add(new URI("https://www.pornhub.com/view_video.php?viewkey=ph5a329fa707269").toURL());
for (URL url : contentURLs) {
PornhubRipper ripper = new PornhubRipper(url);
videoTestHelper(ripper);
}
}
public void testYuvutuRipper() throws IOException {
public void testYuvutuRipper() throws IOException, URISyntaxException {
List<URL> contentURLs = new ArrayList<>();
contentURLs.add(new URL("http://www.yuvutu.com/video/828499/female-reader-armpit-job/"));
contentURLs.add(new URI("http://www.yuvutu.com/video/828499/female-reader-armpit-job/").toURL());
for (URL url : contentURLs) {
YuvutuRipper ripper = new YuvutuRipper(url);
videoTestHelper(ripper);

View File

@@ -1,7 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import com.rarchives.ripme.ripper.rippers.ViewcomicRipper;
import org.junit.jupiter.api.Disabled;
@@ -9,8 +10,8 @@ import org.junit.jupiter.api.Test;
public class ViewcomicRipperTest extends RippersTest {
@Test @Disabled("Ripper broken")
public void testViewcomicRipper() throws IOException {
ViewcomicRipper ripper = new ViewcomicRipper(new URL("https://view-comic.com/batman-no-mans-land-vol-1/"));
public void testViewcomicRipper() throws IOException, URISyntaxException {
ViewcomicRipper ripper = new ViewcomicRipper(new URI("https://view-comic.com/batman-no-mans-land-vol-1/").toURL());
testRipper(ripper);
}
}

View File

@@ -1,7 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import com.rarchives.ripme.ripper.rippers.VkRipper;
import org.json.JSONObject;
@@ -20,21 +21,21 @@ public class VkRipperTest extends RippersTest {
// EXAMPLE: https://vk.com/album45506334_101886701 (a single album - custom)
@Test
@Tag("flaky")
public void testVkAlbumHttpRip() throws IOException {
VkRipper ripper = new VkRipper(new URL("https://vk.com/album45506334_0"));
public void testVkAlbumHttpRip() throws IOException, URISyntaxException {
VkRipper ripper = new VkRipper(new URI("https://vk.com/album45506334_0").toURL());
testRipper(ripper);
}
@Test
@Tag("flaky")
public void testVkPhotosRip() throws IOException {
VkRipper ripper = new VkRipper(new URL("https://vk.com/photos45506334"));
public void testVkPhotosRip() throws IOException, URISyntaxException {
VkRipper ripper = new VkRipper(new URI("https://vk.com/photos45506334").toURL());
testRipper(ripper);
}
@Test
@Tag("flaky")
public void testFindJSONObjectContainingPhotoID() throws IOException {
VkRipper ripper = new VkRipper(new URL("http://vk.com/album45506334_0"));
public void testFindJSONObjectContainingPhotoID() throws IOException, URISyntaxException {
VkRipper ripper = new VkRipper(new URI("http://vk.com/album45506334_0").toURL());
String json =
"{\"payload\":[0,[\"album-45984105_268691406\",18,14,[{\"id\":\"-45984105_457345201\",\"base\":\"https://sun9-37.userapi.com/\",\"tagged\":[],\"likes\":0,\"shares\":0,\"o_src\":\"https://sun9-65.userapi.com/c857520/v857520962/10e24c/DPxygc3XW5E.jpg\",\"o_\":[\"https://sun9-65.userapi.com/c857520/v857520962/10e24c/DPxygc3XW5E\",130,98],\"z_src\":\"https://sun9-41.userapi.com/c857520/v857520962/10e24a/EsDDQA36qKI.jpg\",\"z_\":[\"https://sun9-41.userapi.com/c857520/v857520962/10e24a/EsDDQA36qKI\",1280,960],\"w_src\":\"https://sun9-60.userapi.com/c857520/v857520962/10e24b/6ETsA15rAdU.jpg\",\"w_\":[\"https://sun9-60.userapi.com/c857520/v857520962/10e24b/6ETsA15rAdU\",1405,1054]}]]],\"langVersion\":\"4298\"}";
String responseJson =
@@ -46,8 +47,8 @@ public class VkRipperTest extends RippersTest {
}
@Test
public void testGetBestSourceUrl() throws IOException {
VkRipper ripper = new VkRipper(new URL("http://vk.com/album45506334_0"));
public void testGetBestSourceUrl() throws IOException, URISyntaxException {
VkRipper ripper = new VkRipper(new URI("http://vk.com/album45506334_0").toURL());
String json =
"{\"id\":\"-45984105_457345201\",\"base\":\"https://sun9-37.userapi.com/\",\"commcount\":0,\"date\":\"<span class=\\\"rel_date\\\">3 Dec at 1:14 am</span>\",\"tagged\":[],\"attached_tags\":{\"max_tags_per_object\":5},\"o_src\":\"https://sun9-65.userapi.com/c857520/v857520962/10e24c/DPxygc3XW5E.jpg\",\"o_\":[\"https://sun9-65.userapi.com/c857520/v857520962/10e24c/DPxygc3XW5E\",130,98],\"y_src\":\"https://sun9-9.userapi.com/c857520/v857520962/10e249/dUDeuY10s0A.jpg\",\"y_\":[\"https://sun9-9.userapi.com/c857520/v857520962/10e249/dUDeuY10s0A\",807,605],\"z_src\":\"https://sun9-41.userapi.com/c857520/v857520962/10e24a/EsDDQA36qKI.jpg\",\"z_\":[\"https://sun9-41.userapi.com/c857520/v857520962/10e24a/EsDDQA36qKI\",1280,960]}";
Assertions.assertEquals("https://sun9-41.userapi.com/c857520/v857520962/10e24a/EsDDQA36qKI.jpg",