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

Fix rgif ripper tests

This commit is contained in:
Tush-r
2024-08-29 17:21:01 +05:30
committed by soloturn
parent a7cb78eceb
commit 99a5d88854

View File

@@ -2,7 +2,6 @@ package com.rarchives.ripme.tst.ripper.rippers;
import com.rarchives.ripme.ripper.rippers.RedditRipper; import com.rarchives.ripme.ripper.rippers.RedditRipper;
import com.rarchives.ripme.ripper.rippers.RedgifsRipper; import com.rarchives.ripme.ripper.rippers.RedgifsRipper;
import org.jsoup.nodes.Document;
import org.junit.jupiter.api.*; import org.junit.jupiter.api.*;
import java.io.IOException; import java.io.IOException;
@@ -15,9 +14,8 @@ public class RedgifsRipperTest extends RippersTest {
* Rips correctly formatted URL directly from Redgifs * Rips correctly formatted URL directly from Redgifs
*/ */
@Test @Test
@Disabled("test or ripper broken")
public void testRedgifsGoodURL() throws IOException, URISyntaxException { public void testRedgifsGoodURL() throws IOException, URISyntaxException {
RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/watch/talkativewarpeddragon-petite").toURL()); RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/watch/ashamedselfishcoypu").toURL());
testRipper(ripper); testRipper(ripper);
} }
@@ -25,36 +23,38 @@ public class RedgifsRipperTest extends RippersTest {
* Rips gifdeliverynetwork URL's by redirecting them to proper redgifs url * Rips gifdeliverynetwork URL's by redirecting them to proper redgifs url
*/ */
@Test @Test
@Tag("flaky")
public void testRedgifsBadRL() throws IOException, URISyntaxException { public void testRedgifsBadRL() throws IOException, URISyntaxException {
RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.gifdeliverynetwork.com/foolishelasticchimpanzee").toURL()); RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.gifdeliverynetwork.com/consideratetrustworthypigeon").toURL());
testRipper(ripper); testRipper(ripper);
} }
/** /**
* Rips a Redifs profile * Rips a Redgifs profile
*/ */
@Test @Test
@Tag("flaky")
public void testRedgifsProfile() throws IOException, URISyntaxException { public void testRedgifsProfile() throws IOException, URISyntaxException {
RedgifsRipper ripper = new RedgifsRipper(new URI("https://redgifs.com/users/margo_monty").toURL()); RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/users/ra-kunv2").toURL());
testRipper(ripper); testRipper(ripper);
} }
/** /**
* Rips a Redifs category/search * Rips a Redgif search
* @throws IOException * @throws IOException
*/ */
@Test @Test
@Disabled("test or ripper broken")
public void testRedgifsSearch() throws IOException, URISyntaxException { public void testRedgifsSearch() throws IOException, URISyntaxException {
RedgifsRipper ripper = new RedgifsRipper(new URI("https://redgifs.com/gifs/browse/little-caprice").toURL()); RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/search?query=take+a+shot+every+time").toURL());
Document doc = ripper.getFirstPage(); testRipper(ripper);
}
doc = ripper.getNextPage(doc); /**
Assertions.assertTrue("https://api.redgifs.com/v1/gfycats/search?search_text=little%20caprice&count=150&start=150".equalsIgnoreCase(doc.location())); * Rips Redgif tags
doc = ripper.getNextPage(doc); * @throws IOException
Assertions.assertTrue("https://api.redgifs.com/v1/gfycats/search?search_text=little%20caprice&count=150&start=300".equalsIgnoreCase(doc.location())); */
@Test
public void testRedgifsTags() throws IOException, URISyntaxException {
RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/gifs/animation,sfw,funny?order=best&tab=gifs").toURL());
testRipper(ripper);
} }
@Test @Test